/* Generated by Cython 0.24.1 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "define_macros": [
            [
                "MODULE_NAME", 
                "\"sweepea\""
            ]
        ], 
        "depends": [
            "_pysqlite/connection.h"
        ], 
        "libraries": [
            "sqlite3"
        ]
    }, 
    "module_name": "sweepea"
}
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_24_1"
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
  #define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#if CYTHON_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
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #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 __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #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
#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)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
typedef struct {
    unaryfunc am_await;
    unaryfunc am_aiter;
    unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

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

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if 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__sweepea
#define __PYX_HAVE_API__sweepea
#include "string.h"
#include "stdio.h"
#include "pythread.h"
#include "datetime.h"
#include "float.h"
#include "math.h"
#include "stdlib.h"
#include "sqlite3.h"
#include "_pysqlite/connection.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; 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_COMPILING_IN_CPYTHON
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#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[] = {
  "sweepea.pyx",
  "datetime.pxd",
  "stringsource",
  "type.pxd",
  "bool.pxd",
  "complex.pxd",
};

/*--- Type declarations ---*/
struct __pyx_obj_7sweepea__TableFunctionImpl;
struct __pyx_obj_7sweepea_ResultIterator;
struct __pyx_obj_7sweepea_CursorWrapper;
struct __pyx_obj_7sweepea_NamedTupleCursorWrapper;
struct __pyx_obj_7sweepea__callable_context_manager;
struct __pyx_obj_7sweepea_Database;
struct __pyx_obj_7sweepea__atomic;
struct __pyx_obj_7sweepea__transaction;
struct __pyx_obj_7sweepea__savepoint;
struct __pyx_obj_7sweepea_State;
struct __pyx_obj_7sweepea_Context;
struct __pyx_obj_7sweepea_ColumnFactory;
struct __pyx_obj_7sweepea__DynamicColumn;
struct __pyx_obj_7sweepea__ExplicitColumn;
struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash;
struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator;
struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__;
struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__;
struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__;
struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__;
struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate;
struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation;
struct __pyx_obj_7sweepea___pyx_scope_struct_8_func;
struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function;
struct __pyx_obj_7sweepea___pyx_scope_struct_10___scope_context__;
struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner;
struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy;
struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__;
struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__;
struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr;
struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__;
struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__;
struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr;
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py;
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py;
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object___to_py;
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py;
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py;
struct __pyx_t_7sweepea_sqlite3_index_constraint;
struct __pyx_t_7sweepea_sqlite3_index_orderby;
struct __pyx_t_7sweepea_sqlite3_index_constraint_usage;
struct __pyx_t_7sweepea_peewee_vtab;
typedef struct __pyx_t_7sweepea_peewee_vtab __pyx_t_7sweepea_peewee_vtab;
struct __pyx_t_7sweepea_peewee_cursor;
typedef struct __pyx_t_7sweepea_peewee_cursor __pyx_t_7sweepea_peewee_cursor;
struct __pyx_opt_args_7sweepea_13CursorWrapper_fill_cache;
struct __pyx_opt_args_7sweepea_8Database_execute_sql;
struct __pyx_opt_args_7sweepea_12_transaction_commit;
struct __pyx_opt_args_7sweepea_12_transaction_rollback;

/* "sweepea.pyx":26
 * 
 * 
 * cdef struct sqlite3_index_constraint:             # <<<<<<<<<<<<<<
 *     int iColumn
 *     unsigned char op
 */
struct __pyx_t_7sweepea_sqlite3_index_constraint {
  int iColumn;
  unsigned char op;
  unsigned char usable;
  int iTermOffset;
};

/* "sweepea.pyx":33
 * 
 * 
 * cdef struct sqlite3_index_orderby:             # <<<<<<<<<<<<<<
 *     int iColumn
 *     unsigned char desc
 */
struct __pyx_t_7sweepea_sqlite3_index_orderby {
  int iColumn;
  unsigned char desc;
};

/* "sweepea.pyx":38
 * 
 * 
 * cdef struct sqlite3_index_constraint_usage:             # <<<<<<<<<<<<<<
 *     int argvIndex
 *     unsigned char omit
 */
struct __pyx_t_7sweepea_sqlite3_index_constraint_usage {
  int argvIndex;
  unsigned char omit;
};

/* "sweepea.pyx":236
 * # The peewee_vtab struct embeds the base sqlite3_vtab struct, and adds a field
 * # to store a reference to the Python implementation.
 * ctypedef struct peewee_vtab:             # <<<<<<<<<<<<<<
 *     sqlite3_vtab base
 *     void *table_func_cls
 */
struct __pyx_t_7sweepea_peewee_vtab {
  sqlite3_vtab base;
  void *table_func_cls;
};

/* "sweepea.pyx":245
 * # implementation, the current rows' data, and a flag for whether the cursor has
 * # been exhausted.
 * ctypedef struct peewee_cursor:             # <<<<<<<<<<<<<<
 *     sqlite3_vtab_cursor base
 *     long long idx
 */
struct __pyx_t_7sweepea_peewee_cursor {
  sqlite3_vtab_cursor base;
  PY_LONG_LONG idx;
  void *table_func;
  void *row_data;
  int stopped;
};

/* "sweepea.pyx":908
 *         return inst
 * 
 *     cpdef fill_cache(self, n=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int counter = -1 if n is None else <int>n
 */
struct __pyx_opt_args_7sweepea_13CursorWrapper_fill_cache {
  int __pyx_n;
  PyObject *n;
};

/* "sweepea.pyx":1511
 *         return self._local.conn
 * 
 *     cpdef execute_sql(self, sql, params=None, commit=True):             # <<<<<<<<<<<<<<
 *         """Execute the given SQL query and return the cursor."""
 *         if self._local.closed:
 */
struct __pyx_opt_args_7sweepea_8Database_execute_sql {
  int __pyx_n;
  PyObject *params;
  PyObject *commit;
};

/* "sweepea.pyx":1843
 *         self.db.begin(self.lock)
 * 
 *     cpdef commit(self, bint begin=True):             # <<<<<<<<<<<<<<
 *         self.db.commit()
 *         if begin:
 */
struct __pyx_opt_args_7sweepea_12_transaction_commit {
  int __pyx_n;
  int begin;
};

/* "sweepea.pyx":1848
 *             self._begin()
 * 
 *     cpdef rollback(self, bint begin=True):             # <<<<<<<<<<<<<<
 *         self.db.rollback()
 *         if begin:
 */
struct __pyx_opt_args_7sweepea_12_transaction_rollback {
  int __pyx_n;
  int begin;
};

/* "sweepea.pyx":496
 * 
 * 
 * cdef class _TableFunctionImpl(object):             # <<<<<<<<<<<<<<
 *     cdef:
 *         sqlite3_module module
 */
struct __pyx_obj_7sweepea__TableFunctionImpl {
  PyObject_HEAD
  struct __pyx_vtabstruct_7sweepea__TableFunctionImpl *__pyx_vtab;
  sqlite3_module module;
  PyObject *table_function;
};


/* "sweepea.pyx":821
 * 
 * 
 * cdef class ResultIterator(object):             # <<<<<<<<<<<<<<
 *     cdef:
 *         bint is_populated
 */
struct __pyx_obj_7sweepea_ResultIterator {
  PyObject_HEAD
  int is_populated;
  int index;
  struct __pyx_obj_7sweepea_CursorWrapper *cursor_wrapper;
};


/* "sweepea.pyx":818
 * 
 * 
 * cdef class CursorWrapper(object)  # Forward declaration.             # <<<<<<<<<<<<<<
 * 
 * 
 */
struct __pyx_obj_7sweepea_CursorWrapper {
  PyObject_HEAD
  struct __pyx_vtabstruct_7sweepea_CursorWrapper *__pyx_vtab;
  int is_initialized;
  int is_populated;
  int count;
  int index;
  PyObject *columns;
  PyObject *result_cache;
  PyObject *cursor;
  PyObject *transform;
};


/* "sweepea.pyx":938
 *     return CursorWrapper(cursor, dict_transform)
 * 
 * cdef class NamedTupleCursorWrapper(CursorWrapper)  # Forward declaration.             # <<<<<<<<<<<<<<
 * 
 * cdef namedtuple_transform(NamedTupleCursorWrapper cursor_wrapper, tuple row):
 */
struct __pyx_obj_7sweepea_NamedTupleCursorWrapper {
  struct __pyx_obj_7sweepea_CursorWrapper __pyx_base;
  PyObject *tuple_class;
};


/* "sweepea.pyx":953
 * 
 * 
 * cdef class _callable_context_manager(object):             # <<<<<<<<<<<<<<
 *     def __call__(self, fn):
 *         def inner(*args, **kwargs):
 */
struct __pyx_obj_7sweepea__callable_context_manager {
  PyObject_HEAD
};


/* "sweepea.pyx":1142
 * 
 * 
 * cdef class Database(object):             # <<<<<<<<<<<<<<
 *     """
 *     The :py:class:`Database` provides an additional layer of abstraction over
 */
struct __pyx_obj_7sweepea_Database {
  PyObject_HEAD
  struct __pyx_vtabstruct_7sweepea_Database *__pyx_vtab;
  PyObject *_aggregates;
  PyObject *_collations;
  PyObject *_functions;
  PyObject *_modules;
  PyObject *_function_map;
  PyObject *_table_functions;
  PyObject *_lock;
  PyObject *_commit_hook;
  PyObject *_rollback_hook;
  PyObject *_update_hook;
  PyObject *connect_kwargs;
  PyObject *_pragmas;
  PyObject *database;
  int deferred;
  PyObject *_local;
};


/* "sweepea.pyx":1811
 * 
 * 
 * cdef class _atomic(_callable_context_manager):             # <<<<<<<<<<<<<<
 *     cdef:
 *         Database db
 */
struct __pyx_obj_7sweepea__atomic {
  struct __pyx_obj_7sweepea__callable_context_manager __pyx_base;
  struct __pyx_obj_7sweepea_Database *db;
  PyObject *_helper;
};


/* "sweepea.pyx":1830
 * 
 * 
 * cdef class _transaction(_callable_context_manager):             # <<<<<<<<<<<<<<
 *     cdef:
 *         basestring lock
 */
struct __pyx_obj_7sweepea__transaction {
  struct __pyx_obj_7sweepea__callable_context_manager __pyx_base;
  struct __pyx_vtabstruct_7sweepea__transaction *__pyx_vtab;
  PyObject *lock;
  int _orig;
  struct __pyx_obj_7sweepea_Database *db;
};


/* "sweepea.pyx":1873
 * 
 * 
 * cdef class _savepoint(_callable_context_manager):             # <<<<<<<<<<<<<<
 *     cdef:
 *         basestring sid, quoted_sid
 */
struct __pyx_obj_7sweepea__savepoint {
  struct __pyx_obj_7sweepea__callable_context_manager __pyx_base;
  struct __pyx_vtabstruct_7sweepea__savepoint *__pyx_vtab;
  PyObject *sid;
  PyObject *quoted_sid;
  struct __pyx_obj_7sweepea_Database *db;
};


/* "sweepea.pyx":1914
 * 
 * 
 * cdef class State(object):             # <<<<<<<<<<<<<<
 *     """
 *     Lightweight object for representing the rules applied at a given scope.
 */
struct __pyx_obj_7sweepea_State {
  PyObject_HEAD
  int parentheses;
  int subquery;
  int scope;
};


/* "sweepea.pyx":1943
 * 
 * 
 * cdef class Context(object):             # <<<<<<<<<<<<<<
 *     """
 *     The Context converts SQL fragments into queries and bind-values. Maintains
 */
struct __pyx_obj_7sweepea_Context {
  PyObject_HEAD
  struct __pyx_vtabstruct_7sweepea_Context *__pyx_vtab;
  PyObject *parentheses;
  PyObject *subquery;
  int scope;
  PyObject *stack;
  PyObject *_sql;
  PyObject *_values;
  struct __pyx_obj_7sweepea_State *state;
};


/* "sweepea.pyx":2020
 * 
 * 
 * cdef class ColumnFactory(object):             # <<<<<<<<<<<<<<
 *     """
 *     Lightweight factory for creating Column objects dynamically by overriding
 */
struct __pyx_obj_7sweepea_ColumnFactory {
  PyObject_HEAD
  PyObject *source;
};


/* "sweepea.pyx":2039
 * 
 * 
 * cdef class _DynamicColumn(object):             # <<<<<<<<<<<<<<
 *     """
 *     Descriptor that exposes the ColumnFactory as a "magic" attribute.
 */
struct __pyx_obj_7sweepea__DynamicColumn {
  PyObject_HEAD
};


/* "sweepea.pyx":2049
 * 
 * 
 * cdef class _ExplicitColumn(object):             # <<<<<<<<<<<<<<
 *     """
 *     Descriptor that prevents "magic" attribute lookup for sources that define
 */
struct __pyx_obj_7sweepea__ExplicitColumn {
  PyObject_HEAD
};


/* "sweepea.pyx":776
 * 
 * 
 * def make_hash(hash_impl):             # <<<<<<<<<<<<<<
 *     def inner(*items):
 *         state = hash_impl()
 */
struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash {
  PyObject_HEAD
  PyObject *__pyx_v_hash_impl;
};


/* "sweepea.pyx":888
 *             return row
 * 
 *     def iterator(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.iterate()
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator {
  PyObject_HEAD
  struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self;
};


/* "sweepea.pyx":954
 * 
 * cdef class _callable_context_manager(object):
 *     def __call__(self, fn):             # <<<<<<<<<<<<<<
 *         def inner(*args, **kwargs):
 *             with self:
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__ {
  PyObject_HEAD
  PyObject *__pyx_v_fn;
  struct __pyx_obj_7sweepea__callable_context_manager *__pyx_v_self;
};


/* "sweepea.pyx":963
 * 
 * 
 * def __status__(flag, return_highwater=False):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a sqlite3_status() call for a particular flag as a property of the
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__ {
  PyObject_HEAD
  PyObject *__pyx_v_flag;
  PyObject *__pyx_v_return_highwater;
};


/* "sweepea.pyx":981
 * 
 * 
 * def __dbstatus__(flag, return_highwater=False, return_current=False):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a sqlite3_dbstatus() call for a particular flag as a property of the
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__ {
  PyObject_HEAD
  PyObject *__pyx_v_flag;
  PyObject *__pyx_v_return_current;
  PyObject *__pyx_v_return_highwater;
};


/* "sweepea.pyx":1005
 * 
 * 
 * def __pragma__(name):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a SQLite PRAGMA operation as a property of the Database, with a
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ {
  PyObject_HEAD
  PyObject *__pyx_v_name;
};


/* "sweepea.pyx":1307
 *         conn.create_aggregate(name, nparams, klass)
 * 
 *     def aggregate(self, name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Class decorator for user-defined aggregates.
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate {
  PyObject_HEAD
  PyObject *__pyx_v_name;
  struct __pyx_obj_7sweepea_Database *__pyx_v_self;
};


/* "sweepea.pyx":1335
 *         conn.create_collation(name, fn)
 * 
 *     def collation(self, name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Register a custom collation.
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation {
  PyObject_HEAD
  PyObject *__pyx_v_name;
  struct __pyx_obj_7sweepea_Database *__pyx_v_self;
};


/* "sweepea.pyx":1381
 *             self._function_map[fn] = name
 * 
 *     def func(self, name=None, n=-1, deterministic=True):             # <<<<<<<<<<<<<<
 *         """
 *         Create a user-defined function.
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_8_func {
  PyObject_HEAD
  PyObject *__pyx_v_deterministic;
  PyObject *__pyx_v_n;
  PyObject *__pyx_v_name;
  struct __pyx_obj_7sweepea_Database *__pyx_v_self;
};


/* "sweepea.pyx":1400
 *         return decorator
 * 
 *     def table_function(self, name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Register a table-function with the database.
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function {
  PyObject_HEAD
  PyObject *__pyx_v_name;
  struct __pyx_obj_7sweepea_Database *__pyx_v_self;
};


/* "sweepea.pyx":1935
 * 
 * 
 * def __scope_context__(int scope):             # <<<<<<<<<<<<<<
 *     @contextmanager
 *     def inner(self, **kwargs):
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_10___scope_context__ {
  PyObject_HEAD
  int __pyx_v_scope;
};


/* "sweepea.pyx":1937
 * def __scope_context__(int scope):
 *     @contextmanager
 *     def inner(self, **kwargs):             # <<<<<<<<<<<<<<
 *         with self(scope=scope, **kwargs):
 *             yield self
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner {
  PyObject_HEAD
  struct __pyx_obj_7sweepea___pyx_scope_struct_10___scope_context__ *__pyx_outer_scope;
  PyObject *__pyx_v_kwargs;
  PyObject *__pyx_v_self;
  PyObject *__pyx_t_0;
  PyObject *__pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3;
};


/* "sweepea.pyx":2068
 * 
 *     @staticmethod
 *     def copy(method):             # <<<<<<<<<<<<<<
 *         def inner(self, *args, **kwargs):
 *             clone = self.clone()
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy {
  PyObject_HEAD
  PyObject *__pyx_v_method;
};


/* "sweepea.pyx":2203
 *     def __pos__(self):
 *         return self.asc()
 *     def __e__(op, inv=False):             # <<<<<<<<<<<<<<
 *         def inner(self, rhs):
 *             if inv:
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__ {
  PyObject_HEAD
  PyObject *__pyx_v_inv;
  PyObject *__pyx_v_op;
};


/* "sweepea.pyx":2362
 * 
 * class Entity(EntityBase):
 *     def __init__(self, *path):             # <<<<<<<<<<<<<<
 *         self._path = filter(None, path)
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__ {
  PyObject_HEAD
  PyObject *__pyx_v_self;
};


/* "sweepea.pyx":2364
 *     def __init__(self, *path):
 *         self._path = filter(None, path)
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__ *__pyx_outer_scope;
  PyObject *__pyx_v_part;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "sweepea.pyx":2395
 *         self.arguments = arguments
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         def decorator(*args):
 *             return Function(attr, args)
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__ {
  PyObject_HEAD
  PyObject *__pyx_v_attr;
};


/* "sweepea.pyx":2493
 *         return ctx
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self._cte_list:
 *             recursive = any(cte._recursive for cte in self._cte_list)
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__ {
  PyObject_HEAD
  PyObject *__pyx_v_self;
};


/* "sweepea.pyx":2495
 *     def __sql__(self, Context ctx):
 *         if self._cte_list:
 *             recursive = any(cte._recursive for cte in self._cte_list)             # <<<<<<<<<<<<<<
 *             with ctx.scope_cte():
 *                 (ctx
 */
struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr {
  PyObject_HEAD
  struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__ *__pyx_outer_scope;
  PyObject *__pyx_v_cte;
};


/* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_object____CursorWrapper____tuple___to_py")
 * cdef object __Pyx_CFunc_object____CursorWrapper____tuple___to_py(object (*f)(CursorWrapper, tuple) ):             # <<<<<<<<<<<<<<
 *     def wrap(CursorWrapper cursor_wrapper, tuple row):
 *         """wrap(cursor_wrapper: 'CursorWrapper', row: tuple)"""
 */
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py {
  PyObject_HEAD
  PyObject *(*__pyx_v_f)(struct __pyx_obj_7sweepea_CursorWrapper *, PyObject *);
};

struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py {
  PyObject_HEAD
  PyObject *(*__pyx_v_f)(struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *, PyObject *);
};

struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object___to_py {
  PyObject_HEAD
  float (*__pyx_v_f)(PyObject *);
};

struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py {
  PyObject_HEAD
  float (*__pyx_v_f)(PyObject *, int, float, float);
};

struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py {
  PyObject_HEAD
  int (*__pyx_v_f)(PyObject *, PyObject *);
};



/* "sweepea.pyx":496
 * 
 * 
 * cdef class _TableFunctionImpl(object):             # <<<<<<<<<<<<<<
 *     cdef:
 *         sqlite3_module module
 */

struct __pyx_vtabstruct_7sweepea__TableFunctionImpl {
  PyObject *(*create_module)(struct __pyx_obj_7sweepea__TableFunctionImpl *, pysqlite_Connection *);
};
static struct __pyx_vtabstruct_7sweepea__TableFunctionImpl *__pyx_vtabptr_7sweepea__TableFunctionImpl;


/* "sweepea.pyx":845
 * 
 * 
 * cdef class CursorWrapper(object):             # <<<<<<<<<<<<<<
 *     cdef:
 *         bint is_initialized, is_populated
 */

struct __pyx_vtabstruct_7sweepea_CursorWrapper {
  PyObject *(*initialize)(struct __pyx_obj_7sweepea_CursorWrapper *);
  PyObject *(*iterate)(struct __pyx_obj_7sweepea_CursorWrapper *);
  PyObject *(*fill_cache)(struct __pyx_obj_7sweepea_CursorWrapper *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_13CursorWrapper_fill_cache *__pyx_optional_args);
};
static struct __pyx_vtabstruct_7sweepea_CursorWrapper *__pyx_vtabptr_7sweepea_CursorWrapper;


/* "sweepea.pyx":943
 *     return cursor_wrapper.tuple_class(*row)
 * 
 * cdef class NamedTupleCursorWrapper(CursorWrapper):             # <<<<<<<<<<<<<<
 *     cdef:
 *         object tuple_class
 */

struct __pyx_vtabstruct_7sweepea_NamedTupleCursorWrapper {
  struct __pyx_vtabstruct_7sweepea_CursorWrapper __pyx_base;
};
static struct __pyx_vtabstruct_7sweepea_NamedTupleCursorWrapper *__pyx_vtabptr_7sweepea_NamedTupleCursorWrapper;


/* "sweepea.pyx":1142
 * 
 * 
 * cdef class Database(object):             # <<<<<<<<<<<<<<
 *     """
 *     The :py:class:`Database` provides an additional layer of abstraction over
 */

struct __pyx_vtabstruct_7sweepea_Database {
  PyObject *(*connect)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch);
  int (*close)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch);
  PyObject *(*_create_collation)(struct __pyx_obj_7sweepea_Database *, PyObject *, PyObject *, PyObject *);
  PyObject *(*_create_function)(struct __pyx_obj_7sweepea_Database *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *);
  int (*is_closed)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch);
  PyObject *(*get_conn)(struct __pyx_obj_7sweepea_Database *);
  PyObject *(*execute_sql)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_8Database_execute_sql *__pyx_optional_args);
  PyObject *(*execute)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*sql)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*commit)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch);
  PyObject *(*rollback)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch);
  PyObject *(*_push_transaction)(struct __pyx_obj_7sweepea_Database *, PyObject *);
  PyObject *(*_pop_transaction)(struct __pyx_obj_7sweepea_Database *);
  PyObject *(*_transaction_depth)(struct __pyx_obj_7sweepea_Database *);
  PyObject *(*last_insert_rowid)(struct __pyx_obj_7sweepea_Database *);
  PyObject *(*changes)(struct __pyx_obj_7sweepea_Database *);
  struct __pyx_obj_7sweepea__atomic *(*atomic)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch);
  struct __pyx_obj_7sweepea__transaction *(*transaction)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch);
  struct __pyx_obj_7sweepea__savepoint *(*savepoint)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch);
  PyObject *(*get_tables)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch);
  PyObject *(*get_indexes)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_columns)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_primary_keys)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*get_foreign_keys)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_7sweepea_Database *__pyx_vtabptr_7sweepea_Database;


/* "sweepea.pyx":1830
 * 
 * 
 * cdef class _transaction(_callable_context_manager):             # <<<<<<<<<<<<<<
 *     cdef:
 *         basestring lock
 */

struct __pyx_vtabstruct_7sweepea__transaction {
  PyObject *(*_begin)(struct __pyx_obj_7sweepea__transaction *, int __pyx_skip_dispatch);
  PyObject *(*commit)(struct __pyx_obj_7sweepea__transaction *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_12_transaction_commit *__pyx_optional_args);
  PyObject *(*rollback)(struct __pyx_obj_7sweepea__transaction *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_12_transaction_rollback *__pyx_optional_args);
};
static struct __pyx_vtabstruct_7sweepea__transaction *__pyx_vtabptr_7sweepea__transaction;


/* "sweepea.pyx":1873
 * 
 * 
 * cdef class _savepoint(_callable_context_manager):             # <<<<<<<<<<<<<<
 *     cdef:
 *         basestring sid, quoted_sid
 */

struct __pyx_vtabstruct_7sweepea__savepoint {
  PyObject *(*_execute)(struct __pyx_obj_7sweepea__savepoint *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*commit)(struct __pyx_obj_7sweepea__savepoint *, int __pyx_skip_dispatch);
  PyObject *(*rollback)(struct __pyx_obj_7sweepea__savepoint *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_7sweepea__savepoint *__pyx_vtabptr_7sweepea__savepoint;


/* "sweepea.pyx":1943
 * 
 * 
 * cdef class Context(object):             # <<<<<<<<<<<<<<
 *     """
 *     The Context converts SQL fragments into queries and bind-values. Maintains
 */

struct __pyx_vtabstruct_7sweepea_Context {
  PyObject *(*refresh)(struct __pyx_obj_7sweepea_Context *);
  struct __pyx_obj_7sweepea_Context *(*sql)(struct __pyx_obj_7sweepea_Context *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_7sweepea_Context *(*literal)(struct __pyx_obj_7sweepea_Context *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_7sweepea_Context *(*bind_value)(struct __pyx_obj_7sweepea_Context *, PyObject *);
  struct __pyx_obj_7sweepea_Context *(*__pyx___sql__)(struct __pyx_obj_7sweepea_Context *, struct __pyx_obj_7sweepea_Context *);
  PyObject *(*parse)(struct __pyx_obj_7sweepea_Context *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*query)(struct __pyx_obj_7sweepea_Context *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_7sweepea_Context *__pyx_vtabptr_7sweepea_Context;

/* --- 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_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

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

/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

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

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

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

/* PyThreadStateGet.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#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_COMPILING_IN_CPYTHON
#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);

/* SaveResetException.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#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_COMPILING_IN_CPYTHON
#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_COMPILING_IN_CPYTHON
#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

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

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

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

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

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

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

/* PyObjectSetAttrStr.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

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

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

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

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

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

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

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

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

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

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

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

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

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

/* None.proto */
static CYTHON_INLINE long __Pyx_mod_long(long, long);

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

/* IterNext.proto */
#define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL)
static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject *, PyObject *);

/* PyObjectLookupSpecial.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return __Pyx_PyObject_GetAttrStr(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#else
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

/* PyObjectCallMethod2.proto */
static PyObject* __Pyx_PyObject_CallMethod2(PyObject* obj, PyObject* method_name, PyObject* arg1, PyObject* arg2);

/* dict_setdefault.proto */
static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value, int is_safe_type);

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

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

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

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

/* py_dict_items.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);

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

/* CallUnboundCMethod0.proto */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
    ((likely((cfunc)->func)) ?\
        (likely((cfunc)->flag == METH_NOARGS) ?  (*((cfunc)->func))(self, NULL) :\
         (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
             ((cfunc)->flag == METH_VARARGS ?  (*((cfunc)->func))(self, __pyx_empty_tuple) : __Pyx__CallUnboundCMethod0(cfunc, self)))) :\
        __Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

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

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

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

/* pop.proto */
static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L);
#define __Pyx_PyObject_Pop(L) (likely(PyList_CheckExact(L)) ?\
    __Pyx_PyList_Pop(L) : __Pyx__PyObject_Pop(L))
#else
#define __Pyx_PyList_Pop(L)  __Pyx__PyObject_Pop(L)
#define __Pyx_PyObject_Pop(L)  __Pyx__PyObject_Pop(L)
#endif

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

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

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args))
                PyErr_SetObject(PyExc_KeyError, args);
            Py_XDECREF(args);
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#else
    #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#endif

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

/* SwapException.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#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

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

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

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

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

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

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

/* PyIntBinop.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

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

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

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

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

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

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

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

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

/* 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_int(int value);

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

/* None.proto */
static CYTHON_INLINE long __Pyx_pow_long(long, long);

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

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

/* ClassMethod.proto */
#include "descrobject.h"
static PyObject* __Pyx_Method_ClassMethod(PyObject *method);

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

/* CIntFromPy.proto */
static CYTHON_INLINE sqlite3_int64 __Pyx_PyInt_As_sqlite3_int64(PyObject *);

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

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

/* PyIdentifierFromString.proto */
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#endif
#endif

/* ModuleImport.proto */
static PyObject *__Pyx_ImportModule(const char *name);

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

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

static PyObject *__pyx_f_7sweepea_18_TableFunctionImpl_create_module(struct __pyx_obj_7sweepea__TableFunctionImpl *__pyx_v_self, pysqlite_Connection *__pyx_v_sqlite_conn); /* proto*/
static PyObject *__pyx_f_7sweepea_13CursorWrapper_initialize(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7sweepea_13CursorWrapper_iterate(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7sweepea_13CursorWrapper_fill_cache(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_13CursorWrapper_fill_cache *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_7sweepea_23NamedTupleCursorWrapper_initialize(struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_connect(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static int __pyx_f_7sweepea_8Database_close(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database__create_collation(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_conn, PyObject *__pyx_v_fn, PyObject *__pyx_v_name); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database__create_function(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_conn, PyObject *__pyx_v_fn, PyObject *__pyx_v_name, PyObject *__pyx_v_nparams, PyObject *__pyx_v_deterministic); /* proto*/
static int __pyx_f_7sweepea_8Database_is_closed(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_get_conn(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_execute_sql(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_sql, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_8Database_execute_sql *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_execute(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_query, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_sql(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_query, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_commit(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_rollback(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database__push_transaction(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_txn); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database__pop_transaction(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database__transaction_depth(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_last_insert_rowid(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_changes(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto*/
static struct __pyx_obj_7sweepea__atomic *__pyx_f_7sweepea_8Database_atomic(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_7sweepea__transaction *__pyx_f_7sweepea_8Database_transaction(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_7sweepea__savepoint *__pyx_f_7sweepea_8Database_savepoint(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_get_tables(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_get_indexes(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_get_columns(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_get_primary_keys(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_8Database_get_foreign_keys(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_12_transaction__begin(struct __pyx_obj_7sweepea__transaction *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_12_transaction_commit(struct __pyx_obj_7sweepea__transaction *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_12_transaction_commit *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_7sweepea_12_transaction_rollback(struct __pyx_obj_7sweepea__transaction *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_12_transaction_rollback *__pyx_optional_args); /* proto*/
static PyObject *__pyx_f_7sweepea_10_savepoint__execute(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self, PyObject *__pyx_v_query, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_10_savepoint_commit(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_10_savepoint_rollback(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_7Context_refresh(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto*/
static struct __pyx_obj_7sweepea_Context *__pyx_f_7sweepea_7Context_sql(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_7sweepea_Context *__pyx_f_7sweepea_7Context_literal(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_sql, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_7sweepea_Context *__pyx_f_7sweepea_7Context_bind_value(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value); /* proto*/
static struct __pyx_obj_7sweepea_Context *__pyx_f_7sweepea_7Context___sql__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto*/
static PyObject *__pyx_f_7sweepea_7Context_parse(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_query, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_7sweepea_7Context_query(struct __pyx_obj_7sweepea_Context *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/

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

/* Module declarations from '__builtin__' */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.bool' */
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;

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

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

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.complex' */
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

/* Module declarations from 'cpython' */

/* Module declarations from 'datetime' */

/* Module declarations from 'cpython.datetime' */
static PyTypeObject *__pyx_ptype_7cpython_8datetime_date = 0;
static PyTypeObject *__pyx_ptype_7cpython_8datetime_time = 0;
static PyTypeObject *__pyx_ptype_7cpython_8datetime_datetime = 0;
static PyTypeObject *__pyx_ptype_7cpython_8datetime_timedelta = 0;
static PyTypeObject *__pyx_ptype_7cpython_8datetime_tzinfo = 0;

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

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

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

/* Module declarations from 'sweepea' */
static PyTypeObject *__pyx_ptype_7sweepea__TableFunctionImpl = 0;
static PyTypeObject *__pyx_ptype_7sweepea_CursorWrapper = 0;
static PyTypeObject *__pyx_ptype_7sweepea_ResultIterator = 0;
static PyTypeObject *__pyx_ptype_7sweepea_NamedTupleCursorWrapper = 0;
static PyTypeObject *__pyx_ptype_7sweepea__callable_context_manager = 0;
static PyTypeObject *__pyx_ptype_7sweepea_Database = 0;
static PyTypeObject *__pyx_ptype_7sweepea__atomic = 0;
static PyTypeObject *__pyx_ptype_7sweepea__transaction = 0;
static PyTypeObject *__pyx_ptype_7sweepea__savepoint = 0;
static PyTypeObject *__pyx_ptype_7sweepea_State = 0;
static PyTypeObject *__pyx_ptype_7sweepea_Context = 0;
static PyTypeObject *__pyx_ptype_7sweepea_ColumnFactory = 0;
static PyTypeObject *__pyx_ptype_7sweepea__DynamicColumn = 0;
static PyTypeObject *__pyx_ptype_7sweepea__ExplicitColumn = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct__make_hash = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_1_iterator = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_2___call__ = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_3___status__ = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_4___dbstatus__ = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_5___pragma__ = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_6_aggregate = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_7_collation = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_8_func = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_9_table_function = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_10___scope_context__ = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_11_inner = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_12_copy = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_13___e__ = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_14___init__ = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_15_genexpr = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_16___getattr__ = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_17___sql__ = 0;
static PyTypeObject *__pyx_ptype_7sweepea___pyx_scope_struct_18_genexpr = 0;
static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py = 0;
static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py = 0;
static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_float____object___to_py = 0;
static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py = 0;
static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py = 0;
static int __pyx_f_7sweepea_pwConnect(sqlite3 *, void *, int, char **, sqlite3_vtab **, char **); /*proto*/
static int __pyx_f_7sweepea_pwDisconnect(sqlite3_vtab *); /*proto*/
static int __pyx_f_7sweepea_pwOpen(sqlite3_vtab *, sqlite3_vtab_cursor **); /*proto*/
static int __pyx_f_7sweepea_pwClose(sqlite3_vtab_cursor *); /*proto*/
static int __pyx_f_7sweepea_pwNext(sqlite3_vtab_cursor *); /*proto*/
static int __pyx_f_7sweepea_pwColumn(sqlite3_vtab_cursor *, sqlite3_context *, int); /*proto*/
static int __pyx_f_7sweepea_pwRowid(sqlite3_vtab_cursor *, sqlite3_int64 *); /*proto*/
static int __pyx_f_7sweepea_pwEof(sqlite3_vtab_cursor *); /*proto*/
static int __pyx_f_7sweepea_pwFilter(sqlite3_vtab_cursor *, int, char const *, int, sqlite3_value **); /*proto*/
static int __pyx_f_7sweepea_pwBestIndex(sqlite3_vtab *, sqlite3_index_info *); /*proto*/
static PyObject *__pyx_f_7sweepea__parse_match_info(PyObject *); /*proto*/
static float __pyx_f_7sweepea_rank(PyObject *); /*proto*/
static float __pyx_f_7sweepea_bm25(PyObject *, int, float, float); /*proto*/
static unsigned int __pyx_f_7sweepea_murmurhash2(char const *, int, unsigned int); /*proto*/
static int __pyx_f_7sweepea_regexp(PyObject *, PyObject *); /*proto*/
static int __pyx_f_7sweepea__aggressive_busy_handler(void *, int); /*proto*/
static PyObject *__pyx_f_7sweepea_dict_transform(struct __pyx_obj_7sweepea_CursorWrapper *, PyObject *); /*proto*/
static PyObject *__pyx_f_7sweepea_namedtuple_transform(struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *, PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_7sweepea__check_connection(pysqlite_Connection *); /*proto*/
static PyObject *__pyx_f_7sweepea__sqlite_to_python(sqlite3_context *, int, sqlite3_value **); /*proto*/
static PyObject *__pyx_f_7sweepea__python_to_sqlite(sqlite3_context *, PyObject *); /*proto*/
static void __pyx_f_7sweepea__function_callback(sqlite3_context *, int, sqlite3_value **); /*proto*/
static int __pyx_f_7sweepea__commit_callback(void *); /*proto*/
static void __pyx_f_7sweepea__rollback_callback(void *); /*proto*/
static void __pyx_f_7sweepea__update_callback(void *, int, char *, char *, sqlite3_int64); /*proto*/
static PyObject *__pyx_f_7sweepea_format_datetime(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7sweepea_format_date(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_7sweepea_format_time(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__Pyx_CFunc_object____CursorWrapper____tuple___to_py(PyObject *(*)(struct __pyx_obj_7sweepea_CursorWrapper *, PyObject *)); /*proto*/
static PyObject *__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py(PyObject *(*)(struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *, PyObject *)); /*proto*/
static PyObject *__Pyx_CFunc_float____object___to_py(float (*)(PyObject *)); /*proto*/
static PyObject *__Pyx_CFunc_float____object____int____float____float___to_py(float (*)(PyObject *, int, float, float)); /*proto*/
static PyObject *__Pyx_CFunc_bint____basestring____basestring___to_py(int (*)(PyObject *, PyObject *)); /*proto*/
#define __Pyx_MODULE_NAME "sweepea"
int __pyx_module_is_main_sweepea = 0;

/* Implementation of 'sweepea' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_NotImplementedError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_property;
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_super;
static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_filter;
static PyObject *__pyx_builtin_reduce;
static const char __pyx_k_[] = ",";
static const char __pyx_k_I[] = "@I";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_c[] = "c";
static const char __pyx_k_e[] = "__e__";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_s[] = " = %s";
static const char __pyx_k_AS[] = " AS ";
static const char __pyx_k_IN[] = "IN";
static const char __pyx_k_IS[] = "IS";
static const char __pyx_k_ON[] = " ON ";
static const char __pyx_k_OR[] = "OR";
static const char __pyx_k__5[] = ", ";
static const char __pyx_k_db[] = "db";
static const char __pyx_k_eq[] = "__eq__";
static const char __pyx_k_fn[] = "fn";
static const char __pyx_k_ge[] = "__ge__";
static const char __pyx_k_gt[] = "__gt__";
static const char __pyx_k_hi[] = "hi";
static const char __pyx_k_in[] = "in_";
static const char __pyx_k_k1[] = "k1";
static const char __pyx_k_le[] = "__le__";
static const char __pyx_k_lo[] = "lo";
static const char __pyx_k_lt[] = "__lt__";
static const char __pyx_k_ne[] = "__ne__";
static const char __pyx_k_on[] = "on";
static const char __pyx_k_op[] = "op";
static const char __pyx_k_or[] = "__or__";
static const char __pyx_k_rc[] = "rc";
static const char __pyx_k_re[] = "re";
static const char __pyx_k_AND[] = "AND";
static const char __pyx_k_ASC[] = "ASC";
static const char __pyx_k_Asc[] = "Asc";
static const char __pyx_k_CTE[] = "CTE";
static const char __pyx_k_H_M[] = "%H:%M";
static const char __pyx_k_I_2[] = "I";
static const char __pyx_k_NOT[] = " NOT ";
static const char __pyx_k_Row[] = "Row";
static const char __pyx_k_SET[] = " SET ";
static const char __pyx_k_SQL[] = "SQL";
static const char __pyx_k__23[] = "";
static const char __pyx_k__52[] = "(";
static const char __pyx_k__53[] = ")";
static const char __pyx_k__57[] = " ";
static const char __pyx_k__59[] = "=";
static const char __pyx_k__60[] = "!=";
static const char __pyx_k__63[] = "?";
static const char __pyx_k__64[] = ".";
static const char __pyx_k__71[] = "()";
static const char __pyx_k_add[] = "__add__";
static const char __pyx_k_and[] = "and_";
static const char __pyx_k_arg[] = "arg";
static const char __pyx_k_asc[] = "asc";
static const char __pyx_k_cls[] = "cls";
static const char __pyx_k_cte[] = "cte";
static const char __pyx_k_ctx[] = "ctx";
static const char __pyx_k_div[] = "__div__";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_get[] = "__get__";
static const char __pyx_k_hex[] = "hex";
static const char __pyx_k_idx[] = "idx";
static const char __pyx_k_inv[] = "inv";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_lhs[] = "lhs";
static const char __pyx_k_md5[] = "md5";
static const char __pyx_k_mod[] = "__mod__";
static const char __pyx_k_mul[] = "__mul__";
static const char __pyx_k_neg[] = "__neg__";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_obj[] = "obj";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_pos[] = "__pos__";
static const char __pyx_k_pow[] = "__pow__";
static const char __pyx_k_rhs[] = "rhs";
static const char __pyx_k_ror[] = "__ror__";
static const char __pyx_k_row[] = "row";
static const char __pyx_k_s_2[] = "s";
static const char __pyx_k_s_3[] = "%s";
static const char __pyx_k_s_4[] = " %s ";
static const char __pyx_k_s_5[] = " %s";
static const char __pyx_k_s_6[] = "\"%s\"";
static const char __pyx_k_s_s[] = "%s %s";
static const char __pyx_k_set[] = "__set__";
static const char __pyx_k_sid[] = "sid";
static const char __pyx_k_sql[] = "sql";
static const char __pyx_k_sub[] = "__sub__";
static const char __pyx_k_AS_2[] = " AS (";
static const char __pyx_k_AS_s[] = " AS \"%s\"";
static const char __pyx_k_CAST[] = "CAST(";
static const char __pyx_k_Cast[] = "Cast";
static const char __pyx_k_DATE[] = "DATE";
static const char __pyx_k_DESC[] = "DESC";
static const char __pyx_k_Desc[] = "Desc";
static const char __pyx_k_FROM[] = " FROM ";
static const char __pyx_k_GLOB[] = "GLOB";
static const char __pyx_k_INTO[] = "INTO ";
static const char __pyx_k_Join[] = "Join";
static const char __pyx_k_LIKE[] = "LIKE";
static const char __pyx_k_List[] = "List";
static const char __pyx_k_Lock[] = "Lock";
static const char __pyx_k_Node[] = "Node";
static const char __pyx_k_OR_s[] = "OR %s ";
static const char __pyx_k_TIME[] = "TIME";
static const char __pyx_k_WITH[] = "WITH ";
static const char __pyx_k__194[] = "+";
static const char __pyx_k__196[] = "-";
static const char __pyx_k__198[] = "*";
static const char __pyx_k__200[] = "/";
static const char __pyx_k__202[] = "<";
static const char __pyx_k__204[] = ">";
static const char __pyx_k__206[] = "<=";
static const char __pyx_k__208[] = ">=";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_attr[] = "attr";
static const char __pyx_k_bkey[] = "bkey";
static const char __pyx_k_bm25[] = "bm25";
static const char __pyx_k_cast[] = "cast";
static const char __pyx_k_conn[] = "conn";
static const char __pyx_k_copy[] = "copy";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_date[] = "date";
static const char __pyx_k_desc[] = "desc";
static const char __pyx_k_dest[] = "dest";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_exit[] = "__exit__";
static const char __pyx_k_flag[] = "flag";
static const char __pyx_k_flat[] = "flat";
static const char __pyx_k_from[] = "_from";
static const char __pyx_k_func[] = "func";
static const char __pyx_k_glue[] = "glue";
static const char __pyx_k_impl[] = "impl";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_item[] = "item";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_lock[] = "lock";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_on_2[] = "_on";
static const char __pyx_k_page[] = "page";
static const char __pyx_k_path[] = "_path";
static const char __pyx_k_radd[] = "__radd__";
static const char __pyx_k_rand[] = "__rand__";
static const char __pyx_k_rank[] = "rank";
static const char __pyx_k_rdiv[] = "__rdiv__";
static const char __pyx_k_rmul[] = "__rmul__";
static const char __pyx_k_rsub[] = "__rsub__";
static const char __pyx_k_seed[] = "seed";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_sha1[] = "sha1";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_uuid[] = "uuid";
static const char __pyx_k_with[] = "with_";
static const char __pyx_k_wrap[] = "wrap";
static const char __pyx_k_Alias[] = "Alias";
static const char __pyx_k_BEGIN[] = "BEGIN";
static const char __pyx_k_Check[] = "Check";
static const char __pyx_k_H_M_S[] = "%H:%M:%S";
static const char __pyx_k_INNER[] = "INNER";
static const char __pyx_k_Query[] = "Query";
static const char __pyx_k_Table[] = "Table";
static const char __pyx_k_UNION[] = "UNION";
static const char __pyx_k_Value[] = "Value";
static const char __pyx_k_WHERE[] = " WHERE ";
static const char __pyx_k_Y_m_d[] = "%Y-%m-%d";
static const char __pyx_k_accum[] = "accum";
static const char __pyx_k_alias[] = "alias";
static const char __pyx_k_and_2[] = "__and__";
static const char __pyx_k_begin[] = "begin";
static const char __pyx_k_chain[] = "chain";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_clone[] = "clone";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_dicts[] = "_dicts";
static const char __pyx_k_enter[] = "__enter__";
static const char __pyx_k_get_2[] = "get";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_inner[] = "inner";
static const char __pyx_k_inv_2[] = "__inv__";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_klass[] = "klass";
static const char __pyx_k_lhs_2[] = "_lhs";
static const char __pyx_k_limit[] = "limit";
static const char __pyx_k_local[] = "local";
static const char __pyx_k_multi[] = "multi";
static const char __pyx_k_ncols[] = "_ncols";
static const char __pyx_k_nodes[] = "nodes";
static const char __pyx_k_nseed[] = "nseed";
static const char __pyx_k_nulls[] = "nulls";
static const char __pyx_k_other[] = "other";
static const char __pyx_k_param[] = "param";
static const char __pyx_k_parse[] = "parse";
static const char __pyx_k_query[] = "query";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_regex[] = "regex";
static const char __pyx_k_rhs_2[] = "_rhs";
static const char __pyx_k_scope[] = "scope";
static const char __pyx_k_split[] = "split";
static const char __pyx_k_sql_2[] = "__sql__";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_table[] = "table";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_utf_8[] = "utf-8";
static const char __pyx_k_uuid4[] = "uuid4";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_where[] = "where";
static const char __pyx_k_AS_s_2[] = " AS %s)";
static const char __pyx_k_Column[] = "Column";
static const char __pyx_k_DELETE[] = "DELETE";
static const char __pyx_k_Delete[] = "Delete";
static const char __pyx_k_EXCEPT[] = "EXCEPT";
static const char __pyx_k_Entity[] = "Entity";
static const char __pyx_k_HAVING[] = " HAVING ";
static const char __pyx_k_INSERT[] = "INSERT";
static const char __pyx_k_IS_NOT[] = "IS NOT";
static const char __pyx_k_Insert[] = "Insert";
static const char __pyx_k_NOT_IN[] = "NOT IN";
static const char __pyx_k_SELECT[] = "SELECT ";
static const char __pyx_k_Select[] = "Select";
static const char __pyx_k_Source[] = "Source";
static const char __pyx_k_UPDATE[] = "UPDATE";
static const char __pyx_k_Update[] = "Update";
static const char __pyx_k_VALUES[] = " VALUES ";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_atomic[] = "atomic";
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_delete[] = "delete";
static const char __pyx_k_encode[] = "encode";
static const char __pyx_k_entity[] = "entity";
static const char __pyx_k_exc_tb[] = "exc_tb";
static const char __pyx_k_filter[] = "filter";
static const char __pyx_k_getter[] = "getter";
static const char __pyx_k_having[] = "having";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_init_2[] = "init";
static const char __pyx_k_insert[] = "insert";
static const char __pyx_k_invert[] = "__invert__";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_lshift[] = "__lshift__";
static const char __pyx_k_method[] = "method";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_not_in[] = "not_in";
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_path_2[] = "path";
static const char __pyx_k_pragma[] = "pragma";
static const char __pyx_k_quoted[] = "_quoted";
static const char __pyx_k_reduce[] = "reduce";
static const char __pyx_k_regexp[] = "regexp";
static const char __pyx_k_rshift[] = "__rshift__";
static const char __pyx_k_s_JOIN[] = " %s JOIN ";
static const char __pyx_k_schema[] = "schema";
static const char __pyx_k_search[] = "search";
static const char __pyx_k_select[] = "select";
static const char __pyx_k_sha256[] = "sha256";
static const char __pyx_k_source[] = "source";
static const char __pyx_k_status[] = "__status__";
static const char __pyx_k_struct[] = "struct";
static const char __pyx_k_unpack[] = "unpack";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_BEGIN_s[] = "BEGIN %s";
static const char __pyx_k_BETWEEN[] = "BETWEEN";
static const char __pyx_k_CHECK_s[] = "CHECK (%s)";
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_Join_on[] = "Join.on";
static const char __pyx_k_LIMIT_d[] = " LIMIT %d";
static const char __pyx_k_NULLS_s[] = " NULLS %s";
static const char __pyx_k_Negated[] = "Negated";
static const char __pyx_k_alias_2[] = "_alias";
static const char __pyx_k_as_dict[] = "as_dict";
static const char __pyx_k_begin_2[] = "_begin";
static const char __pyx_k_between[] = "between";
static const char __pyx_k_collate[] = "collate";
static const char __pyx_k_columns[] = "columns";
static const char __pyx_k_connect[] = "connect";
static const char __pyx_k_current[] = "current";
static const char __pyx_k_decimal[] = "decimal";
static const char __pyx_k_dicts_2[] = "dicts";
static const char __pyx_k_exc_val[] = "exc_val";
static const char __pyx_k_execute[] = "execute";
static const char __pyx_k_filters[] = "filters";
static const char __pyx_k_fn_name[] = "fn_name";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_getattr[] = "__getattr__";
static const char __pyx_k_hashlib[] = "hashlib";
static const char __pyx_k_is_flat[] = "is_flat";
static const char __pyx_k_is_null[] = "is_null";
static const char __pyx_k_iterate[] = "iterate";
static const char __pyx_k_limit_2[] = "_limit";
static const char __pyx_k_literal[] = "literal";
static const char __pyx_k_nparams[] = "nparams";
static const char __pyx_k_objects[] = "_objects";
static const char __pyx_k_pragmas[] = "pragmas";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_query_2[] = "_query";
static const char __pyx_k_sqlite3[] = "sqlite3";
static const char __pyx_k_sweepea[] = "sweepea";
static const char __pyx_k_timeout[] = "timeout";
static const char __pyx_k_where_2[] = "_where";
static const char __pyx_k_DATETIME[] = "DATETIME";
static const char __pyx_k_DEFERRED[] = "DEFERRED";
static const char __pyx_k_Function[] = "Function";
static const char __pyx_k_GROUP_BY[] = " GROUP BY ";
static const char __pyx_k_INSERT_2[] = "INSERT ";
static const char __pyx_k_OFFSET_d[] = " OFFSET %d";
static const char __pyx_k_ORDER_BY[] = " ORDER BY ";
static const char __pyx_k_Ordering[] = "Ordering";
static const char __pyx_k_PRAGMA_s[] = "PRAGMA %s";
static const char __pyx_k_UPDATE_2[] = "UPDATE ";
static const char __pyx_k_cte_list[] = "_cte_list";
static const char __pyx_k_cursor_2[] = "_cursor";
static const char __pyx_k_database[] = "database";
static const char __pyx_k_dbstatus[] = "__dbstatus__";
static const char __pyx_k_distinct[] = "distinct";
static const char __pyx_k_exc_type[] = "exc_type";
static const char __pyx_k_fetchall[] = "fetchall";
static const char __pyx_k_fetchone[] = "fetchone";
static const char __pyx_k_group_by[] = "group_by";
static const char __pyx_k_hash_md5[] = "hash_md5";
static const char __pyx_k_having_2[] = "_having";
static const char __pyx_k_iterator[] = "iterator";
static const char __pyx_k_offset_2[] = "_offset";
static const char __pyx_k_operator[] = "operator";
static const char __pyx_k_order_by[] = "order_by";
static const char __pyx_k_paginate[] = "paginate";
static const char __pyx_k_pragma_2[] = "__pragma__";
static const char __pyx_k_property[] = "property";
static const char __pyx_k_pysqlite[] = "pysqlite";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_register[] = "register";
static const char __pyx_k_rollback[] = "rollback";
static const char __pyx_k_s_HIDDEN[] = "%s HIDDEN";
static const char __pyx_k_schema_2[] = "_schema";
static const char __pyx_k_sentinel[] = "__sentinel__";
static const char __pyx_k_strptime[] = "strptime";
static const char __pyx_k_subquery[] = "subquery";
static const char __pyx_k_COLLATE_s[] = " COLLATE %s";
static const char __pyx_k_CTE___sql[] = "CTE.__sql__";
static const char __pyx_k_CommaList[] = "CommaList";
static const char __pyx_k_Exception[] = "Exception";
static const char __pyx_k_INTERSECT[] = "INTERSECT";
static const char __pyx_k_Node_copy[] = "Node.copy";
static const char __pyx_k_SCOPE_CTE[] = "SCOPE_CTE";
static const char __pyx_k_SQL___sql[] = "SQL.__sql__";
static const char __pyx_k_UNION_ALL[] = "UNION ALL";
static const char __pyx_k_arguments[] = "arguments";
static const char __pyx_k_as_object[] = "as_object";
static const char __pyx_k_cache_hit[] = "cache_hit";
static const char __pyx_k_collation[] = "collation";
static const char __pyx_k_columns_2[] = "_columns";
static const char __pyx_k_decorator[] = "decorator";
static const char __pyx_k_direction[] = "direction";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_execute_2[] = "_execute";
static const char __pyx_k_hash_impl[] = "hash_impl";
static const char __pyx_k_hash_sha1[] = "hash_sha1";
static const char __pyx_k_hexdigest[] = "hexdigest";
static const char __pyx_k_highwater[] = "highwater";
static const char __pyx_k_is_closed[] = "is_closed";
static const char __pyx_k_is_flat_2[] = "_is_flat";
static const char __pyx_k_itertools[] = "itertools";
static const char __pyx_k_join_type[] = "join_type";
static const char __pyx_k_lock_type[] = "lock_type";
static const char __pyx_k_make_hash[] = "make_hash";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_mmap_size[] = "mmap_size";
static const char __pyx_k_objects_2[] = "objects";
static const char __pyx_k_page_size[] = "page_size";
static const char __pyx_k_predicate[] = "predicate";
static const char __pyx_k_recursive[] = "recursive";
static const char __pyx_k_rows_iter[] = "rows_iter";
static const char __pyx_k_savepoint[] = "savepoint";
static const char __pyx_k_scope_cte[] = "scope_cte";
static const char __pyx_k_selection[] = "selection";
static const char __pyx_k_threading[] = "threading";
static const char __pyx_k_transform[] = "transform";
static const char __pyx_k_CTE___init[] = "CTE.__init__";
static const char __pyx_k_Cast___sql[] = "Cast.__sql__";
static const char __pyx_k_EntityBase[] = "EntityBase";
static const char __pyx_k_Expression[] = "Expression";
static const char __pyx_k_Join___sql[] = "Join.__sql__";
static const char __pyx_k_LEFT_OUTER[] = "LEFT OUTER";
static const char __pyx_k_List___sql[] = "List.__sql__";
static const char __pyx_k_Node_clone[] = "Node.clone";
static const char __pyx_k_PRAGMA_s_s[] = "PRAGMA %s = %s;";
static const char __pyx_k_Query_with[] = "Query.with_";
static const char __pyx_k_SQL___init[] = "SQL.__init__";
static const char __pyx_k_SelectBase[] = "SelectBase";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_WriteQuery[] = "WriteQuery";
static const char __pyx_k_all_values[] = "all_values";
static const char __pyx_k_cache_miss[] = "cache_miss";
static const char __pyx_k_cache_size[] = "cache_size";
static const char __pyx_k_cache_used[] = "cache_used";
static const char __pyx_k_connection[] = "connection";
static const char __pyx_k_constraint[] = "constraint";
static const char __pyx_k_contextlib[] = "contextlib";
static const char __pyx_k_cte_list_2[] = "cte_list";
static const char __pyx_k_distinct_2[] = "_distinct";
static const char __pyx_k_fill_cache[] = "fill_cache";
static const char __pyx_k_get_tables[] = "get_tables";
static const char __pyx_k_group_by_2[] = "_group_by";
static const char __pyx_k_initialize[] = "initialize";
static const char __pyx_k_murmurhash[] = "murmurhash";
static const char __pyx_k_namedtuple[] = "namedtuple";
static const char __pyx_k_order_by_2[] = "_order_by";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_setdefault[] = "setdefault";
static const char __pyx_k_Alias___sql[] = "Alias.__sql__";
static const char __pyx_k_Alias_alias[] = "Alias.alias";
static const char __pyx_k_Cast___init[] = "Cast.__init__";
static const char __pyx_k_DELETE_FROM[] = "DELETE FROM ";
static const char __pyx_k_Join___init[] = "Join.__init__";
static const char __pyx_k_List___init[] = "List.__init__";
static const char __pyx_k_Query___sql[] = "Query.__sql__";
static const char __pyx_k_Query_clone[] = "Query.clone";
static const char __pyx_k_Query_limit[] = "Query.limit";
static const char __pyx_k_SAVEPOINT_s[] = "SAVEPOINT %s;";
static const char __pyx_k_Select_join[] = "Select.join";
static const char __pyx_k_Source_join[] = "Source.join";
static const char __pyx_k_Table___sql[] = "Table.__sql__";
static const char __pyx_k_Table_clone[] = "Table.clone";
static const char __pyx_k_Value___sql[] = "Value.__sql__";
static const char __pyx_k_Y_m_d_H_M_S[] = "%Y-%m-%d %H:%M:%S";
static const char __pyx_k_apply_alias[] = "apply_alias";
static const char __pyx_k_bind_values[] = "bind_values";
static const char __pyx_k_cache_write[] = "cache_write";
static const char __pyx_k_cfunc_to_py[] = "cfunc.to_py";
static const char __pyx_k_collections[] = "collections";
static const char __pyx_k_description[] = "description";
static const char __pyx_k_execute_sql[] = "execute_sql";
static const char __pyx_k_expressions[] = "expressions";
static const char __pyx_k_format_date[] = "format_date";
static const char __pyx_k_format_time[] = "format_time";
static const char __pyx_k_from_clause[] = "from_clause";
static const char __pyx_k_get_columns[] = "get_columns";
static const char __pyx_k_get_indexes[] = "get_indexes";
static const char __pyx_k_hash_sha256[] = "hash_sha256";
static const char __pyx_k_is_distinct[] = "is_distinct";
static const char __pyx_k_is_subquery[] = "is_subquery";
static const char __pyx_k_join_type_2[] = "_join_type";
static const char __pyx_k_malloc_size[] = "malloc_size";
static const char __pyx_k_memory_used[] = "memory_used";
static const char __pyx_k_on_conflict[] = "on_conflict";
static const char __pyx_k_parentheses[] = "parentheses";
static const char __pyx_k_recursive_2[] = "_recursive";
static const char __pyx_k_schema_used[] = "schema_used";
static const char __pyx_k_synchronous[] = "synchronous";
static const char __pyx_k_transaction[] = "transaction";
static const char __pyx_k_Alias___init[] = "Alias.__init__";
static const char __pyx_k_Column___sql[] = "Column.__sql__";
static const char __pyx_k_Delete___sql[] = "Delete.__sql__";
static const char __pyx_k_Delete_where[] = "Delete.where";
static const char __pyx_k_EnclosedList[] = "EnclosedList";
static const char __pyx_k_Entity___sql[] = "Entity.__sql__";
static const char __pyx_k_Insert___sql[] = "Insert.__sql__";
static const char __pyx_k_Query___init[] = "Query.__init__";
static const char __pyx_k_Query_offset[] = "Query.offset";
static const char __pyx_k_SCOPE_NORMAL[] = "SCOPE_NORMAL";
static const char __pyx_k_SCOPE_SOURCE[] = "SCOPE_SOURCE";
static const char __pyx_k_SCOPE_VALUES[] = "SCOPE_VALUES";
static const char __pyx_k_Select___sql[] = "Select.__sql__";
static const char __pyx_k_Select_dicts[] = "Select.dicts";
static const char __pyx_k_Select_where[] = "Select.where";
static const char __pyx_k_Source_alias[] = "Source.alias";
static const char __pyx_k_Table___init[] = "Table.__init__";
static const char __pyx_k_Table_delete[] = "Table.delete";
static const char __pyx_k_Table_insert[] = "Table.insert";
static const char __pyx_k_Table_select[] = "Table.select";
static const char __pyx_k_Table_update[] = "Table.update";
static const char __pyx_k_Update___sql[] = "Update.__sql__";
static const char __pyx_k_Update_where[] = "Update.where";
static const char __pyx_k_Value___init[] = "Value.__init__";
static const char __pyx_k_column_index[] = "column_index";
static const char __pyx_k_detect_types[] = "detect_types";
static const char __pyx_k_foreign_keys[] = "foreign_keys";
static const char __pyx_k_journal_mode[] = "journal_mode";
static const char __pyx_k_malloc_count[] = "malloc_count";
static const char __pyx_k_multi_insert[] = "_multi_insert";
static const char __pyx_k_query_insert[] = "_query_insert";
static const char __pyx_k_scope_normal[] = "scope_normal";
static const char __pyx_k_scope_source[] = "scope_source";
static const char __pyx_k_scope_values[] = "scope_values";
static const char __pyx_k_scratch_size[] = "scratch_size";
static const char __pyx_k_scratch_used[] = "scratch_used";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_transactions[] = "transactions";
static const char __pyx_k_Column___init[] = "Column.__init__";
static const char __pyx_k_DatabaseError[] = "DatabaseError";
static const char __pyx_k_Delete___init[] = "Delete.__init__";
static const char __pyx_k_EntityWrapper[] = "EntityWrapper";
static const char __pyx_k_Entity___init[] = "Entity.__init__";
static const char __pyx_k_Insert___init[] = "Insert.__init__";
static const char __pyx_k_Negated___sql[] = "Negated.__sql__";
static const char __pyx_k_Query_execute[] = "Query.execute";
static const char __pyx_k_Select___init[] = "Select.__init__";
static const char __pyx_k_Select_having[] = "Select.having";
static const char __pyx_k_Select_select[] = "Select.select";
static const char __pyx_k_Source___init[] = "Source.__init__";
static const char __pyx_k_Source_select[] = "Source.select";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_TableFunction[] = "TableFunction";
static const char __pyx_k_Update___init[] = "Update.__init__";
static const char __pyx_k_Y_m_d_H_M_S_f[] = "%Y-%m-%d %H:%M:%S.%f";
static const char __pyx_k_deterministic[] = "deterministic";
static const char __pyx_k_lookaside_hit[] = "lookaside_hit";
static const char __pyx_k_on_conflict_2[] = "_on_conflict";
static const char __pyx_k_scope_context[] = "__scope_context__";
static const char __pyx_k_simple_insert[] = "_simple_insert";
static const char __pyx_k_AttributeError[] = "AttributeError";
static const char __pyx_k_CompoundSelect[] = "CompoundSelect";
static const char __pyx_k_DEFAULT_VALUES[] = "DEFAULT VALUES";
static const char __pyx_k_Delete_execute[] = "Delete.execute";
static const char __pyx_k_EntityBase___e[] = "EntityBase.__e__";
static const char __pyx_k_EntityBase_asc[] = "EntityBase.asc";
static const char __pyx_k_Function___sql[] = "Function.__sql__";
static const char __pyx_k_Insert_execute[] = "Insert.execute";
static const char __pyx_k_InterfaceError[] = "InterfaceError";
static const char __pyx_k_Ordering___sql[] = "Ordering.__sql__";
static const char __pyx_k_Query_order_by[] = "Query.order_by";
static const char __pyx_k_Query_paginate[] = "Query.paginate";
static const char __pyx_k_SelectBase_cte[] = "SelectBase.cte";
static const char __pyx_k_Select_execute[] = "Select.execute";
static const char __pyx_k_Select_objects[] = "Select.objects";
static const char __pyx_k_Update_execute[] = "Update.execute";
static const char __pyx_k_WITH_RECURSIVE[] = "WITH RECURSIVE ";
static const char __pyx_k_aggregate_name[] = "aggregate_name";
static const char __pyx_k_apply_ordering[] = "apply_ordering";
static const char __pyx_k_collation_name[] = "collation_name";
static const char __pyx_k_contextmanager[] = "contextmanager";
static const char __pyx_k_cursor_wrapper[] = "cursor_wrapper";
static const char __pyx_k_hash_functions[] = "hash_functions";
static const char __pyx_k_lookaside_miss[] = "lookaside_miss";
static const char __pyx_k_lookaside_used[] = "lookaside_used";
static const char __pyx_k_pagecache_size[] = "pagecache_size";
static const char __pyx_k_pagecache_used[] = "pagecache_used";
static const char __pyx_k_rank_functions[] = "rank_functions";
static const char __pyx_k_raw_match_info[] = "raw_match_info";
static const char __pyx_k_regex_function[] = "regex_function";
static const char __pyx_k_return_current[] = "return_current";
static const char __pyx_k_statement_used[] = "statement_used";
static const char __pyx_k_table_function[] = "table_function";
static const char __pyx_k_ConnectionLocal[] = "ConnectionLocal";
static const char __pyx_k_EntityBase___eq[] = "EntityBase.__eq__";
static const char __pyx_k_EntityBase___ne[] = "EntityBase.__ne__";
static const char __pyx_k_EntityBase_desc[] = "EntityBase.desc";
static const char __pyx_k_Function___init[] = "Function.__init__";
static const char __pyx_k_Ordering___init[] = "Ordering.__init__";
static const char __pyx_k_PARSE_DECLTYPES[] = "PARSE_DECLTYPES";
static const char __pyx_k_SELECT_DISTINCT[] = "SELECT DISTINCT ";
static const char __pyx_k_SelectBase___or[] = "SelectBase.__or__";
static const char __pyx_k_Select_distinct[] = "Select.distinct";
static const char __pyx_k_Select_group_by[] = "Select.group_by";
static const char __pyx_k_format_datetime[] = "format_datetime";
static const char __pyx_k_group_by_extend[] = "group_by_extend";
static const char __pyx_k_isolation_level[] = "isolation_level";
static const char __pyx_k_left_outer_join[] = "left_outer_join";
static const char __pyx_k_nested_cte_list[] = "_nested_cte_list";
static const char __pyx_k_order_by_extend[] = "order_by_extend";
static const char __pyx_k_set_commit_hook[] = "_set_commit_hook";
static const char __pyx_k_set_update_hook[] = "_set_update_hook";
static const char __pyx_k_CREATE_TABLE_x_s[] = "CREATE TABLE x(%s);";
static const char __pyx_k_EntityBase___inv[] = "EntityBase.__inv__";
static const char __pyx_k_EntityBase___neg[] = "EntityBase.__neg__";
static const char __pyx_k_EntityBase___pos[] = "EntityBase.__pos__";
static const char __pyx_k_EntityBase_alias[] = "EntityBase.alias";
static const char __pyx_k_Expression___sql[] = "Expression.__sql__";
static const char __pyx_k_Negated___invert[] = "Negated.__invert__";
static const char __pyx_k_OperationalError[] = "OperationalError";
static const char __pyx_k_Ordering_collate[] = "Ordering.collate";
static const char __pyx_k_SelectBase___add[] = "SelectBase.__add__";
static const char __pyx_k_SelectBase___and[] = "SelectBase.__and__";
static const char __pyx_k_SelectBase___sub[] = "SelectBase.__sub__";
static const char __pyx_k_create_aggregate[] = "_create_aggregate";
static const char __pyx_k_create_collation[] = "create_collation";
static const char __pyx_k_get_foreign_keys[] = "get_foreign_keys";
static const char __pyx_k_get_primary_keys[] = "get_primary_keys";
static const char __pyx_k_read_uncommitted[] = "read_uncommitted";
static const char __pyx_k_register_adapter[] = "register_adapter";
static const char __pyx_k_return_highwater[] = "return_highwater";
static const char __pyx_k_scratch_overflow[] = "scratch_overflow";
static const char __pyx_k_DictCursorWrapper[] = "DictCursorWrapper";
static const char __pyx_k_Expression___init[] = "Expression.__init__";
static const char __pyx_k_WriteQuery___init[] = "WriteQuery.__init__";
static const char __pyx_k_cache_used_shared[] = "cache_used_shared";
static const char __pyx_k_set_rollback_hook[] = "_set_rollback_hook";
static const char __pyx_k_EntityBase_between[] = "EntityBase.between";
static const char __pyx_k_EntityBase_is_null[] = "EntityBase.is_null";
static const char __pyx_k_Function___getattr[] = "Function.__getattr__";
static const char __pyx_k_Insert_on_conflict[] = "Insert.on_conflict";
static const char __pyx_k_Source_apply_alias[] = "Source.apply_alias";
static const char __pyx_k_Unsupported_type_s[] = "Unsupported type %s";
static const char __pyx_k_Update_on_conflict[] = "Update.on_conflict";
static const char __pyx_k_create_aggregate_2[] = "create_aggregate";
static const char __pyx_k_journal_size_limit[] = "journal_size_limit";
static const char __pyx_k_pagecache_overflow[] = "pagecache_overflow";
static const char __pyx_k_register_converter[] = "register_converter";
static const char __pyx_k_wal_autocheckpoint[] = "wal_autocheckpoint";
static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
static const char __pyx_k_PRAGMA_index_info_s[] = "PRAGMA index_info(\"%s\")";
static const char __pyx_k_PRAGMA_index_list_s[] = "PRAGMA index_list(\"%s\")";
static const char __pyx_k_PRAGMA_table_info_s[] = "PRAGMA table_info(\"%s\")";
static const char __pyx_k_RELEASE_SAVEPOINT_s[] = "RELEASE SAVEPOINT %s;";
static const char __pyx_k_SQLITE_DATE_FORMATS[] = "SQLITE_DATE_FORMATS";
static const char __pyx_k_SQLITE_TIME_FORMATS[] = "SQLITE_TIME_FORMATS";
static const char __pyx_k_call___locals_inner[] = "__call__.<locals>.inner";
static const char __pyx_k_lookaside_miss_full[] = "lookaside_miss_full";
static const char __pyx_k_CompoundSelect___sql[] = "CompoundSelect.__sql__";
static const char __pyx_k_EntityWrapper___init[] = "EntityWrapper.__init__";
static const char __pyx_k_Insert__multi_insert[] = "Insert._multi_insert";
static const char __pyx_k_Insert__query_insert[] = "Insert._query_insert";
static const char __pyx_k_Query_apply_ordering[] = "Query.apply_ordering";
static const char __pyx_k_CompoundSelect___init[] = "CompoundSelect.__init__";
static const char __pyx_k_Insert__simple_insert[] = "Insert._simple_insert";
static const char __pyx_k_No_sources_to_join_on[] = "No sources to join on.";
static const char __pyx_k_Query_order_by_extend[] = "Query.order_by_extend";
static const char __pyx_k_TableFunction_iterate[] = "TableFunction.iterate";
static const char __pyx_k_func_locals_decorator[] = "func.<locals>.decorator";
static const char __pyx_k_initialize_connection[] = "initialize_connection";
static const char __pyx_k_pragma___locals___get[] = "__pragma__.<locals>.__get__";
static const char __pyx_k_pragma___locals___set[] = "__pragma__.<locals>.__set__";
static const char __pyx_k_CompoundSelect_execute[] = "CompoundSelect.execute";
static const char __pyx_k_ConnectionLocal___init[] = "ConnectionLocal.__init__";
static const char __pyx_k_CursorWrapper_iterator[] = "CursorWrapper.iterator";
static const char __pyx_k_Node_copy_locals_inner[] = "Node.copy.<locals>.inner";
static const char __pyx_k_Select_group_by_extend[] = "Select.group_by_extend";
static const char __pyx_k_Source_left_outer_join[] = "Source.left_outer_join";
static const char __pyx_k_TableFunction_register[] = "TableFunction.register";
static const char __pyx_k_make_hash_locals_inner[] = "make_hash.<locals>.inner";
static const char __pyx_k_status___locals_getter[] = "__status__.<locals>.getter";
static const char __pyx_k_ROLLBACK_TO_SAVEPOINT_s[] = "ROLLBACK TO SAVEPOINT %s;";
static const char __pyx_k_SQLITE_DATETIME_FORMATS[] = "SQLITE_DATETIME_FORMATS";
static const char __pyx_k_TableFunction_initialize[] = "TableFunction.initialize";
static const char __pyx_k_dbstatus___locals_getter[] = "__dbstatus__.<locals>.getter";
static const char __pyx_k_Error_requesting_status_s[] = "Error requesting status: %s";
static const char __pyx_k_PRAGMA_foreign_key_list_s[] = "PRAGMA foreign_key_list(\"%s\")";
static const char __pyx_k_Connection_not_initialized[] = "Connection not initialized.";
static const char __pyx_k_aggregate_locals_decorator[] = "aggregate.<locals>.decorator";
static const char __pyx_k_collation_locals_decorator[] = "collation.<locals>.decorator";
static const char __pyx_k_Error_requesting_db_status_s[] = "Error requesting db status: %s";
static const char __pyx_k_Pyx_CFunc_bint____basestring[] = "__Pyx_CFunc_bint____basestring____basestring___to_py.<locals>.wrap";
static const char __pyx_k_Query___sql___locals_genexpr[] = "Query.__sql__.<locals>.genexpr";
static const char __pyx_k_scope_context___locals_inner[] = "__scope_context__.<locals>.inner";
static const char __pyx_k_EntityBase___e___locals_inner[] = "EntityBase.__e__.<locals>.inner";
static const char __pyx_k_get_table_columns_declaration[] = "get_table_columns_declaration";
static const char __pyx_k_Entity___init___locals_genexpr[] = "Entity.__init__.<locals>.genexpr";
static const char __pyx_k_Pyx_CFunc_float____object____i[] = "__Pyx_CFunc_float____object____int____float____float___to_py.<locals>.wrap";
static const char __pyx_k_Pyx_CFunc_float____object___to[] = "__Pyx_CFunc_float____object___to_py.<locals>.wrap";
static const char __pyx_k_Pyx_CFunc_object____CursorWrap[] = "__Pyx_CFunc_object____CursorWrapper____tuple___to_py.<locals>.wrap";
static const char __pyx_k_Pyx_CFunc_object____NamedTuple[] = "__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py.<locals>.wrap";
static const char __pyx_k_s_specifies_columns_explicitly[] = "%s specifies columns explicitly and does not support dynamic column lookups.";
static const char __pyx_k_Connection_already_open_in_this[] = "Connection already open in this thread.";
static const char __pyx_k_Implements_a_table_valued_funct[] = "\n    Implements a table-valued function (eponymous-only virtual table) in\n    SQLite.\n\n    Subclasses must define the columns (return values) and params (input\n    values) to their function. These are defined as class attributes.\n\n    The subclass also must implement two functions:\n\n    * initialize(**query)\n    * iterate(idx)\n\n    The `initialize` function accepts the query parameters passed in from\n    the SQL query. The `iterate` function accepts the index of the current\n    iteration (zero-based) and must return a tuple of result values or raise\n    a `StopIteration` to signal no more results.\n    ";
static const char __pyx_k_TableFunction_get_table_columns[] = "TableFunction.get_table_columns_declaration";
static const char __pyx_k_Thread_local_storage_for_connec[] = "\n    Thread-local storage for connection state and transaction management.\n    ";
static const char __pyx_k_home_charles_code_sweepea_sweep[] = "/home/charles/code/sweepea/sweepea.pyx";
static const char __pyx_k_table_function_locals_decorator[] = "table_function.<locals>.decorator";
static const char __pyx_k_Cannot_operate_on_closed_databas[] = "Cannot operate on closed database.";
static const char __pyx_k_Column_must_be_either_a_string_o[] = "Column must be either a string or a 2-tuple of name, type";
static const char __pyx_k_Database_has_not_been_initialize[] = "Database has not been initialized.";
static const char __pyx_k_Error_calling_sqlite3_create_fun[] = "Error calling sqlite3_create_function.";
static const char __pyx_k_Function___getattr___locals_deco[] = "Function.__getattr__.<locals>.decorator";
static const char __pyx_k_SELECT_name_FROM_sqlite_master_W[] = "SELECT name FROM sqlite_master WHERE type = ? ORDER BY name;";
static const char __pyx_k_SELECT_name_sql_FROM_sqlite_mast[] = "SELECT name, sql FROM sqlite_master WHERE tbl_name = ? AND type = ? ORDER BY name";
static PyObject *__pyx_kp_s_;
static PyObject *__pyx_n_s_AND;
static PyObject *__pyx_kp_s_AS;
static PyObject *__pyx_n_s_ASC;
static PyObject *__pyx_kp_s_AS_2;
static PyObject *__pyx_kp_s_AS_s;
static PyObject *__pyx_kp_s_AS_s_2;
static PyObject *__pyx_n_s_Alias;
static PyObject *__pyx_n_s_Alias___init;
static PyObject *__pyx_n_s_Alias___sql;
static PyObject *__pyx_n_s_Alias_alias;
static PyObject *__pyx_n_s_Asc;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_n_s_BEGIN;
static PyObject *__pyx_kp_s_BEGIN_s;
static PyObject *__pyx_n_s_BETWEEN;
static PyObject *__pyx_kp_s_CAST;
static PyObject *__pyx_kp_s_CHECK_s;
static PyObject *__pyx_kp_s_COLLATE_s;
static PyObject *__pyx_kp_s_CREATE_TABLE_x_s;
static PyObject *__pyx_n_s_CTE;
static PyObject *__pyx_n_s_CTE___init;
static PyObject *__pyx_n_s_CTE___sql;
static PyObject *__pyx_kp_s_Cannot_operate_on_closed_databas;
static PyObject *__pyx_n_s_Cast;
static PyObject *__pyx_n_s_Cast___init;
static PyObject *__pyx_n_s_Cast___sql;
static PyObject *__pyx_n_s_Check;
static PyObject *__pyx_n_s_Column;
static PyObject *__pyx_n_s_Column___init;
static PyObject *__pyx_n_s_Column___sql;
static PyObject *__pyx_kp_s_Column_must_be_either_a_string_o;
static PyObject *__pyx_n_s_CommaList;
static PyObject *__pyx_n_s_CompoundSelect;
static PyObject *__pyx_n_s_CompoundSelect___init;
static PyObject *__pyx_n_s_CompoundSelect___sql;
static PyObject *__pyx_n_s_CompoundSelect_execute;
static PyObject *__pyx_n_s_ConnectionLocal;
static PyObject *__pyx_n_s_ConnectionLocal___init;
static PyObject *__pyx_kp_s_Connection_already_open_in_this;
static PyObject *__pyx_kp_s_Connection_not_initialized;
static PyObject *__pyx_n_s_CursorWrapper_iterator;
static PyObject *__pyx_n_s_DATE;
static PyObject *__pyx_n_s_DATETIME;
static PyObject *__pyx_kp_s_DEFAULT_VALUES;
static PyObject *__pyx_n_s_DEFERRED;
static PyObject *__pyx_n_s_DELETE;
static PyObject *__pyx_kp_s_DELETE_FROM;
static PyObject *__pyx_n_s_DESC;
static PyObject *__pyx_n_s_DatabaseError;
static PyObject *__pyx_kp_s_Database_has_not_been_initialize;
static PyObject *__pyx_n_s_Decimal;
static PyObject *__pyx_n_s_Delete;
static PyObject *__pyx_n_s_Delete___init;
static PyObject *__pyx_n_s_Delete___sql;
static PyObject *__pyx_n_s_Delete_execute;
static PyObject *__pyx_n_s_Delete_where;
static PyObject *__pyx_n_s_Desc;
static PyObject *__pyx_n_s_DictCursorWrapper;
static PyObject *__pyx_n_s_EXCEPT;
static PyObject *__pyx_n_s_EnclosedList;
static PyObject *__pyx_n_s_Entity;
static PyObject *__pyx_n_s_EntityBase;
static PyObject *__pyx_n_s_EntityBase___e;
static PyObject *__pyx_n_s_EntityBase___e___locals_inner;
static PyObject *__pyx_n_s_EntityBase___eq;
static PyObject *__pyx_n_s_EntityBase___inv;
static PyObject *__pyx_n_s_EntityBase___ne;
static PyObject *__pyx_n_s_EntityBase___neg;
static PyObject *__pyx_n_s_EntityBase___pos;
static PyObject *__pyx_n_s_EntityBase_alias;
static PyObject *__pyx_n_s_EntityBase_asc;
static PyObject *__pyx_n_s_EntityBase_between;
static PyObject *__pyx_n_s_EntityBase_desc;
static PyObject *__pyx_n_s_EntityBase_is_null;
static PyObject *__pyx_n_s_EntityWrapper;
static PyObject *__pyx_n_s_EntityWrapper___init;
static PyObject *__pyx_n_s_Entity___init;
static PyObject *__pyx_n_s_Entity___init___locals_genexpr;
static PyObject *__pyx_n_s_Entity___sql;
static PyObject *__pyx_kp_s_Error_calling_sqlite3_create_fun;
static PyObject *__pyx_kp_s_Error_requesting_db_status_s;
static PyObject *__pyx_kp_s_Error_requesting_status_s;
static PyObject *__pyx_n_s_Exception;
static PyObject *__pyx_n_s_Expression;
static PyObject *__pyx_n_s_Expression___init;
static PyObject *__pyx_n_s_Expression___sql;
static PyObject *__pyx_kp_s_FROM;
static PyObject *__pyx_n_s_Function;
static PyObject *__pyx_n_s_Function___getattr;
static PyObject *__pyx_n_s_Function___getattr___locals_deco;
static PyObject *__pyx_n_s_Function___init;
static PyObject *__pyx_n_s_Function___sql;
static PyObject *__pyx_n_s_GLOB;
static PyObject *__pyx_kp_s_GROUP_BY;
static PyObject *__pyx_kp_s_HAVING;
static PyObject *__pyx_kp_s_H_M;
static PyObject *__pyx_kp_s_H_M_S;
static PyObject *__pyx_kp_s_H_M_S_f;
static PyObject *__pyx_kp_s_I;
static PyObject *__pyx_n_s_IN;
static PyObject *__pyx_n_s_INNER;
static PyObject *__pyx_n_s_INSERT;
static PyObject *__pyx_kp_s_INSERT_2;
static PyObject *__pyx_n_s_INTERSECT;
static PyObject *__pyx_kp_s_INTO;
static PyObject *__pyx_n_s_IS;
static PyObject *__pyx_kp_s_IS_NOT;
static PyObject *__pyx_n_s_I_2;
static PyObject *__pyx_kp_s_Implements_a_table_valued_funct;
static PyObject *__pyx_n_s_Insert;
static PyObject *__pyx_n_s_Insert___init;
static PyObject *__pyx_n_s_Insert___sql;
static PyObject *__pyx_n_s_Insert__multi_insert;
static PyObject *__pyx_n_s_Insert__query_insert;
static PyObject *__pyx_n_s_Insert__simple_insert;
static PyObject *__pyx_n_s_Insert_execute;
static PyObject *__pyx_n_s_Insert_on_conflict;
static PyObject *__pyx_n_s_InterfaceError;
static PyObject *__pyx_n_s_Join;
static PyObject *__pyx_n_s_Join___init;
static PyObject *__pyx_n_s_Join___sql;
static PyObject *__pyx_n_s_Join_on;
static PyObject *__pyx_kp_s_LEFT_OUTER;
static PyObject *__pyx_n_s_LIKE;
static PyObject *__pyx_kp_s_LIMIT_d;
static PyObject *__pyx_n_s_List;
static PyObject *__pyx_n_s_List___init;
static PyObject *__pyx_n_s_List___sql;
static PyObject *__pyx_n_s_Lock;
static PyObject *__pyx_kp_s_NOT;
static PyObject *__pyx_kp_s_NOT_IN;
static PyObject *__pyx_kp_s_NULLS_s;
static PyObject *__pyx_n_s_Negated;
static PyObject *__pyx_n_s_Negated___invert;
static PyObject *__pyx_n_s_Negated___sql;
static PyObject *__pyx_kp_s_No_sources_to_join_on;
static PyObject *__pyx_n_s_Node;
static PyObject *__pyx_n_s_Node_clone;
static PyObject *__pyx_n_s_Node_copy;
static PyObject *__pyx_n_s_Node_copy_locals_inner;
static PyObject *__pyx_n_s_NotImplementedError;
static PyObject *__pyx_kp_s_OFFSET_d;
static PyObject *__pyx_kp_s_ON;
static PyObject *__pyx_n_s_OR;
static PyObject *__pyx_kp_s_ORDER_BY;
static PyObject *__pyx_kp_s_OR_s;
static PyObject *__pyx_n_s_OperationalError;
static PyObject *__pyx_n_s_Ordering;
static PyObject *__pyx_n_s_Ordering___init;
static PyObject *__pyx_n_s_Ordering___sql;
static PyObject *__pyx_n_s_Ordering_collate;
static PyObject *__pyx_n_s_PARSE_DECLTYPES;
static PyObject *__pyx_kp_s_PRAGMA_foreign_key_list_s;
static PyObject *__pyx_kp_s_PRAGMA_index_info_s;
static PyObject *__pyx_kp_s_PRAGMA_index_list_s;
static PyObject *__pyx_kp_s_PRAGMA_s;
static PyObject *__pyx_kp_s_PRAGMA_s_s;
static PyObject *__pyx_kp_s_PRAGMA_table_info_s;
static PyObject *__pyx_n_s_Pyx_CFunc_bint____basestring;
static PyObject *__pyx_n_s_Pyx_CFunc_float____object____i;
static PyObject *__pyx_n_s_Pyx_CFunc_float____object___to;
static PyObject *__pyx_n_s_Pyx_CFunc_object____CursorWrap;
static PyObject *__pyx_n_s_Pyx_CFunc_object____NamedTuple;
static PyObject *__pyx_n_s_Query;
static PyObject *__pyx_n_s_Query___init;
static PyObject *__pyx_n_s_Query___sql;
static PyObject *__pyx_n_s_Query___sql___locals_genexpr;
static PyObject *__pyx_n_s_Query_apply_ordering;
static PyObject *__pyx_n_s_Query_clone;
static PyObject *__pyx_n_s_Query_execute;
static PyObject *__pyx_n_s_Query_limit;
static PyObject *__pyx_n_s_Query_offset;
static PyObject *__pyx_n_s_Query_order_by;
static PyObject *__pyx_n_s_Query_order_by_extend;
static PyObject *__pyx_n_s_Query_paginate;
static PyObject *__pyx_n_s_Query_with;
static PyObject *__pyx_kp_s_RELEASE_SAVEPOINT_s;
static PyObject *__pyx_kp_s_ROLLBACK_TO_SAVEPOINT_s;
static PyObject *__pyx_n_s_Row;
static PyObject *__pyx_kp_s_SAVEPOINT_s;
static PyObject *__pyx_n_s_SCOPE_CTE;
static PyObject *__pyx_n_s_SCOPE_NORMAL;
static PyObject *__pyx_n_s_SCOPE_SOURCE;
static PyObject *__pyx_n_s_SCOPE_VALUES;
static PyObject *__pyx_kp_s_SELECT;
static PyObject *__pyx_kp_s_SELECT_DISTINCT;
static PyObject *__pyx_kp_s_SELECT_name_FROM_sqlite_master_W;
static PyObject *__pyx_kp_s_SELECT_name_sql_FROM_sqlite_mast;
static PyObject *__pyx_kp_s_SET;
static PyObject *__pyx_n_s_SQL;
static PyObject *__pyx_n_s_SQLITE_DATETIME_FORMATS;
static PyObject *__pyx_n_s_SQLITE_DATE_FORMATS;
static PyObject *__pyx_n_s_SQLITE_TIME_FORMATS;
static PyObject *__pyx_n_s_SQL___init;
static PyObject *__pyx_n_s_SQL___sql;
static PyObject *__pyx_n_s_Select;
static PyObject *__pyx_n_s_SelectBase;
static PyObject *__pyx_n_s_SelectBase___add;
static PyObject *__pyx_n_s_SelectBase___and;
static PyObject *__pyx_n_s_SelectBase___or;
static PyObject *__pyx_n_s_SelectBase___sub;
static PyObject *__pyx_n_s_SelectBase_cte;
static PyObject *__pyx_n_s_Select___init;
static PyObject *__pyx_n_s_Select___sql;
static PyObject *__pyx_n_s_Select_dicts;
static PyObject *__pyx_n_s_Select_distinct;
static PyObject *__pyx_n_s_Select_execute;
static PyObject *__pyx_n_s_Select_group_by;
static PyObject *__pyx_n_s_Select_group_by_extend;
static PyObject *__pyx_n_s_Select_having;
static PyObject *__pyx_n_s_Select_join;
static PyObject *__pyx_n_s_Select_objects;
static PyObject *__pyx_n_s_Select_select;
static PyObject *__pyx_n_s_Select_where;
static PyObject *__pyx_n_s_Source;
static PyObject *__pyx_n_s_Source___init;
static PyObject *__pyx_n_s_Source_alias;
static PyObject *__pyx_n_s_Source_apply_alias;
static PyObject *__pyx_n_s_Source_join;
static PyObject *__pyx_n_s_Source_left_outer_join;
static PyObject *__pyx_n_s_Source_select;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_n_s_TIME;
static PyObject *__pyx_n_s_Table;
static PyObject *__pyx_n_s_TableFunction;
static PyObject *__pyx_n_s_TableFunction_get_table_columns;
static PyObject *__pyx_n_s_TableFunction_initialize;
static PyObject *__pyx_n_s_TableFunction_iterate;
static PyObject *__pyx_n_s_TableFunction_register;
static PyObject *__pyx_n_s_Table___init;
static PyObject *__pyx_n_s_Table___sql;
static PyObject *__pyx_n_s_Table_clone;
static PyObject *__pyx_n_s_Table_delete;
static PyObject *__pyx_n_s_Table_insert;
static PyObject *__pyx_n_s_Table_select;
static PyObject *__pyx_n_s_Table_update;
static PyObject *__pyx_kp_s_Thread_local_storage_for_connec;
static PyObject *__pyx_n_s_UNION;
static PyObject *__pyx_kp_s_UNION_ALL;
static PyObject *__pyx_n_s_UPDATE;
static PyObject *__pyx_kp_s_UPDATE_2;
static PyObject *__pyx_kp_s_Unsupported_type_s;
static PyObject *__pyx_n_s_Update;
static PyObject *__pyx_n_s_Update___init;
static PyObject *__pyx_n_s_Update___sql;
static PyObject *__pyx_n_s_Update_execute;
static PyObject *__pyx_n_s_Update_on_conflict;
static PyObject *__pyx_n_s_Update_where;
static PyObject *__pyx_kp_s_VALUES;
static PyObject *__pyx_n_s_Value;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_Value___init;
static PyObject *__pyx_n_s_Value___sql;
static PyObject *__pyx_kp_s_WHERE;
static PyObject *__pyx_kp_s_WITH;
static PyObject *__pyx_kp_s_WITH_RECURSIVE;
static PyObject *__pyx_n_s_WriteQuery;
static PyObject *__pyx_n_s_WriteQuery___init;
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_s__194;
static PyObject *__pyx_kp_s__196;
static PyObject *__pyx_kp_s__198;
static PyObject *__pyx_kp_s__200;
static PyObject *__pyx_kp_s__202;
static PyObject *__pyx_kp_s__204;
static PyObject *__pyx_kp_s__206;
static PyObject *__pyx_kp_s__208;
static PyObject *__pyx_kp_s__23;
static PyObject *__pyx_kp_s__5;
static PyObject *__pyx_kp_s__52;
static PyObject *__pyx_kp_s__53;
static PyObject *__pyx_kp_s__57;
static PyObject *__pyx_kp_s__59;
static PyObject *__pyx_kp_s__60;
static PyObject *__pyx_kp_s__63;
static PyObject *__pyx_kp_s__64;
static PyObject *__pyx_kp_s__71;
static PyObject *__pyx_n_s_accum;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_aggregate_locals_decorator;
static PyObject *__pyx_n_s_aggregate_name;
static PyObject *__pyx_n_s_alias;
static PyObject *__pyx_n_s_alias_2;
static PyObject *__pyx_n_s_all_values;
static PyObject *__pyx_n_s_and;
static PyObject *__pyx_n_s_and_2;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_apply_alias;
static PyObject *__pyx_n_s_apply_ordering;
static PyObject *__pyx_n_s_arg;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_arguments;
static PyObject *__pyx_n_s_as_dict;
static PyObject *__pyx_n_s_as_object;
static PyObject *__pyx_n_s_asc;
static PyObject *__pyx_n_s_atomic;
static PyObject *__pyx_n_s_attr;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_s_begin;
static PyObject *__pyx_n_s_begin_2;
static PyObject *__pyx_n_s_between;
static PyObject *__pyx_n_s_bind_values;
static PyObject *__pyx_n_s_bkey;
static PyObject *__pyx_n_s_bm25;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_s_cache_hit;
static PyObject *__pyx_n_s_cache_miss;
static PyObject *__pyx_n_s_cache_size;
static PyObject *__pyx_n_s_cache_used;
static PyObject *__pyx_n_s_cache_used_shared;
static PyObject *__pyx_n_s_cache_write;
static PyObject *__pyx_n_s_call___locals_inner;
static PyObject *__pyx_n_s_cast;
static PyObject *__pyx_n_s_cfunc_to_py;
static PyObject *__pyx_n_s_chain;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_clone;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_closed;
static PyObject *__pyx_n_s_cls;
static PyObject *__pyx_n_s_collate;
static PyObject *__pyx_n_s_collation;
static PyObject *__pyx_n_s_collation_locals_decorator;
static PyObject *__pyx_n_s_collation_name;
static PyObject *__pyx_n_s_collections;
static PyObject *__pyx_n_s_column;
static PyObject *__pyx_n_s_column_index;
static PyObject *__pyx_n_s_columns;
static PyObject *__pyx_n_s_columns_2;
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_constraint;
static PyObject *__pyx_n_s_contextlib;
static PyObject *__pyx_n_s_contextmanager;
static PyObject *__pyx_n_s_copy;
static PyObject *__pyx_n_s_create_aggregate;
static PyObject *__pyx_n_s_create_aggregate_2;
static PyObject *__pyx_n_s_create_collation;
static PyObject *__pyx_n_s_cte;
static PyObject *__pyx_n_s_cte_list;
static PyObject *__pyx_n_s_cte_list_2;
static PyObject *__pyx_n_s_ctx;
static PyObject *__pyx_n_s_current;
static PyObject *__pyx_n_s_cursor;
static PyObject *__pyx_n_s_cursor_2;
static PyObject *__pyx_n_s_cursor_wrapper;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_database;
static PyObject *__pyx_n_s_date;
static PyObject *__pyx_n_s_db;
static PyObject *__pyx_n_s_dbstatus;
static PyObject *__pyx_n_s_dbstatus___locals_getter;
static PyObject *__pyx_n_s_decimal;
static PyObject *__pyx_n_s_decorator;
static PyObject *__pyx_n_s_delete;
static PyObject *__pyx_n_s_desc;
static PyObject *__pyx_n_s_description;
static PyObject *__pyx_n_s_dest;
static PyObject *__pyx_n_s_detect_types;
static PyObject *__pyx_n_s_deterministic;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_dicts;
static PyObject *__pyx_n_s_dicts_2;
static PyObject *__pyx_n_s_direction;
static PyObject *__pyx_n_s_distinct;
static PyObject *__pyx_n_s_distinct_2;
static PyObject *__pyx_n_s_div;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_e;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_enter;
static PyObject *__pyx_n_s_entity;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_eq;
static PyObject *__pyx_n_s_exc_tb;
static PyObject *__pyx_n_s_exc_type;
static PyObject *__pyx_n_s_exc_val;
static PyObject *__pyx_n_s_execute;
static PyObject *__pyx_n_s_execute_2;
static PyObject *__pyx_n_s_execute_sql;
static PyObject *__pyx_n_s_exit;
static PyObject *__pyx_n_s_expressions;
static PyObject *__pyx_n_s_fetchall;
static PyObject *__pyx_n_s_fetchone;
static PyObject *__pyx_n_s_fill_cache;
static PyObject *__pyx_n_s_filter;
static PyObject *__pyx_n_s_filters;
static PyObject *__pyx_n_s_flag;
static PyObject *__pyx_n_s_flat;
static PyObject *__pyx_n_s_fn;
static PyObject *__pyx_n_s_fn_name;
static PyObject *__pyx_n_s_foreign_keys;
static PyObject *__pyx_n_s_format_date;
static PyObject *__pyx_n_s_format_datetime;
static PyObject *__pyx_n_s_format_time;
static PyObject *__pyx_n_s_from;
static PyObject *__pyx_n_s_from_clause;
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_n_s_func_locals_decorator;
static PyObject *__pyx_n_s_ge;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_2;
static PyObject *__pyx_n_s_get_columns;
static PyObject *__pyx_n_s_get_foreign_keys;
static PyObject *__pyx_n_s_get_indexes;
static PyObject *__pyx_n_s_get_primary_keys;
static PyObject *__pyx_n_s_get_table_columns_declaration;
static PyObject *__pyx_n_s_get_tables;
static PyObject *__pyx_n_s_getattr;
static PyObject *__pyx_n_s_getter;
static PyObject *__pyx_n_s_glue;
static PyObject *__pyx_n_s_group_by;
static PyObject *__pyx_n_s_group_by_2;
static PyObject *__pyx_n_s_group_by_extend;
static PyObject *__pyx_n_s_gt;
static PyObject *__pyx_n_s_hash_functions;
static PyObject *__pyx_n_s_hash_impl;
static PyObject *__pyx_n_s_hash_md5;
static PyObject *__pyx_n_s_hash_sha1;
static PyObject *__pyx_n_s_hash_sha256;
static PyObject *__pyx_n_s_hashlib;
static PyObject *__pyx_n_s_having;
static PyObject *__pyx_n_s_having_2;
static PyObject *__pyx_n_s_hex;
static PyObject *__pyx_n_s_hexdigest;
static PyObject *__pyx_n_s_hi;
static PyObject *__pyx_n_s_highwater;
static PyObject *__pyx_kp_s_home_charles_code_sweepea_sweep;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_idx;
static PyObject *__pyx_n_s_impl;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_in;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_init_2;
static PyObject *__pyx_n_s_initialize;
static PyObject *__pyx_n_s_initialize_connection;
static PyObject *__pyx_n_s_inner;
static PyObject *__pyx_n_s_insert;
static PyObject *__pyx_n_s_inv;
static PyObject *__pyx_n_s_inv_2;
static PyObject *__pyx_n_s_invert;
static PyObject *__pyx_n_s_is_closed;
static PyObject *__pyx_n_s_is_distinct;
static PyObject *__pyx_n_s_is_flat;
static PyObject *__pyx_n_s_is_flat_2;
static PyObject *__pyx_n_s_is_null;
static PyObject *__pyx_n_s_is_subquery;
static PyObject *__pyx_n_s_isolation_level;
static PyObject *__pyx_n_s_item;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_iterate;
static PyObject *__pyx_n_s_iterator;
static PyObject *__pyx_n_s_itertools;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_join_type;
static PyObject *__pyx_n_s_join_type_2;
static PyObject *__pyx_n_s_journal_mode;
static PyObject *__pyx_n_s_journal_size_limit;
static PyObject *__pyx_n_s_k1;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_klass;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_le;
static PyObject *__pyx_n_s_left_outer_join;
static PyObject *__pyx_n_s_lhs;
static PyObject *__pyx_n_s_lhs_2;
static PyObject *__pyx_n_s_limit;
static PyObject *__pyx_n_s_limit_2;
static PyObject *__pyx_n_s_literal;
static PyObject *__pyx_n_s_lo;
static PyObject *__pyx_n_s_local;
static PyObject *__pyx_n_s_lock;
static PyObject *__pyx_n_s_lock_type;
static PyObject *__pyx_n_s_lookaside_hit;
static PyObject *__pyx_n_s_lookaside_miss;
static PyObject *__pyx_n_s_lookaside_miss_full;
static PyObject *__pyx_n_s_lookaside_used;
static PyObject *__pyx_n_s_lshift;
static PyObject *__pyx_n_s_lt;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_make_hash;
static PyObject *__pyx_n_s_make_hash_locals_inner;
static PyObject *__pyx_n_s_malloc_count;
static PyObject *__pyx_n_s_malloc_size;
static PyObject *__pyx_n_s_md5;
static PyObject *__pyx_n_s_memory_used;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_method;
static PyObject *__pyx_n_s_mmap_size;
static PyObject *__pyx_n_s_mod;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_mul;
static PyObject *__pyx_n_s_multi;
static PyObject *__pyx_n_s_multi_insert;
static PyObject *__pyx_n_s_murmurhash;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_namedtuple;
static PyObject *__pyx_n_s_ncols;
static PyObject *__pyx_n_s_ne;
static PyObject *__pyx_n_s_neg;
static PyObject *__pyx_n_s_nested_cte_list;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_nodes;
static PyObject *__pyx_n_s_not_in;
static PyObject *__pyx_n_s_nparams;
static PyObject *__pyx_n_s_nseed;
static PyObject *__pyx_n_s_nulls;
static PyObject *__pyx_n_s_obj;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_objects;
static PyObject *__pyx_n_s_objects_2;
static PyObject *__pyx_n_s_offset;
static PyObject *__pyx_n_s_offset_2;
static PyObject *__pyx_n_s_on;
static PyObject *__pyx_n_s_on_2;
static PyObject *__pyx_n_s_on_conflict;
static PyObject *__pyx_n_s_on_conflict_2;
static PyObject *__pyx_n_s_op;
static PyObject *__pyx_n_s_operator;
static PyObject *__pyx_n_s_or;
static PyObject *__pyx_n_s_order_by;
static PyObject *__pyx_n_s_order_by_2;
static PyObject *__pyx_n_s_order_by_extend;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_page;
static PyObject *__pyx_n_s_page_size;
static PyObject *__pyx_n_s_pagecache_overflow;
static PyObject *__pyx_n_s_pagecache_size;
static PyObject *__pyx_n_s_pagecache_used;
static PyObject *__pyx_n_s_paginate;
static PyObject *__pyx_n_s_param;
static PyObject *__pyx_n_s_params;
static PyObject *__pyx_n_s_parentheses;
static PyObject *__pyx_n_s_parse;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_path_2;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_pos;
static PyObject *__pyx_n_s_pow;
static PyObject *__pyx_n_s_pragma;
static PyObject *__pyx_n_s_pragma_2;
static PyObject *__pyx_n_s_pragma___locals___get;
static PyObject *__pyx_n_s_pragma___locals___set;
static PyObject *__pyx_n_s_pragmas;
static PyObject *__pyx_n_s_predicate;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_property;
static PyObject *__pyx_n_s_pysqlite;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_query;
static PyObject *__pyx_n_s_query_2;
static PyObject *__pyx_n_s_query_insert;
static PyObject *__pyx_n_s_quoted;
static PyObject *__pyx_n_s_radd;
static PyObject *__pyx_n_s_rand;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_rank;
static PyObject *__pyx_n_s_rank_functions;
static PyObject *__pyx_n_s_raw_match_info;
static PyObject *__pyx_n_s_rc;
static PyObject *__pyx_n_s_rdiv;
static PyObject *__pyx_n_s_re;
static PyObject *__pyx_n_s_read_uncommitted;
static PyObject *__pyx_n_s_recursive;
static PyObject *__pyx_n_s_recursive_2;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_regex;
static PyObject *__pyx_n_s_regex_function;
static PyObject *__pyx_n_s_regexp;
static PyObject *__pyx_n_s_register;
static PyObject *__pyx_n_s_register_adapter;
static PyObject *__pyx_n_s_register_converter;
static PyObject *__pyx_n_s_return_current;
static PyObject *__pyx_n_s_return_highwater;
static PyObject *__pyx_n_s_rhs;
static PyObject *__pyx_n_s_rhs_2;
static PyObject *__pyx_n_s_rmul;
static PyObject *__pyx_n_s_rollback;
static PyObject *__pyx_n_s_ror;
static PyObject *__pyx_n_s_row;
static PyObject *__pyx_n_s_rows_iter;
static PyObject *__pyx_n_s_rshift;
static PyObject *__pyx_n_s_rsub;
static PyObject *__pyx_kp_s_s;
static PyObject *__pyx_n_s_s_2;
static PyObject *__pyx_kp_s_s_3;
static PyObject *__pyx_kp_s_s_4;
static PyObject *__pyx_kp_s_s_5;
static PyObject *__pyx_kp_s_s_6;
static PyObject *__pyx_kp_s_s_HIDDEN;
static PyObject *__pyx_kp_s_s_JOIN;
static PyObject *__pyx_kp_s_s_s;
static PyObject *__pyx_kp_s_s_specifies_columns_explicitly;
static PyObject *__pyx_n_s_savepoint;
static PyObject *__pyx_n_s_schema;
static PyObject *__pyx_n_s_schema_2;
static PyObject *__pyx_n_s_schema_used;
static PyObject *__pyx_n_s_scope;
static PyObject *__pyx_n_s_scope_context;
static PyObject *__pyx_n_s_scope_context___locals_inner;
static PyObject *__pyx_n_s_scope_cte;
static PyObject *__pyx_n_s_scope_normal;
static PyObject *__pyx_n_s_scope_source;
static PyObject *__pyx_n_s_scope_values;
static PyObject *__pyx_n_s_scratch_overflow;
static PyObject *__pyx_n_s_scratch_size;
static PyObject *__pyx_n_s_scratch_used;
static PyObject *__pyx_n_s_search;
static PyObject *__pyx_n_s_seed;
static PyObject *__pyx_n_s_select;
static PyObject *__pyx_n_s_selection;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_sentinel;
static PyObject *__pyx_n_s_set;
static PyObject *__pyx_n_s_set_commit_hook;
static PyObject *__pyx_n_s_set_rollback_hook;
static PyObject *__pyx_n_s_set_update_hook;
static PyObject *__pyx_n_s_setdefault;
static PyObject *__pyx_n_s_sha1;
static PyObject *__pyx_n_s_sha256;
static PyObject *__pyx_n_s_sid;
static PyObject *__pyx_n_s_simple_insert;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_sql;
static PyObject *__pyx_n_s_sql_2;
static PyObject *__pyx_n_s_sqlite3;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_statement_used;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_status;
static PyObject *__pyx_n_s_status___locals_getter;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_strptime;
static PyObject *__pyx_n_s_struct;
static PyObject *__pyx_n_s_sub;
static PyObject *__pyx_n_s_subquery;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_sweepea;
static PyObject *__pyx_n_s_synchronous;
static PyObject *__pyx_n_s_table;
static PyObject *__pyx_n_s_table_function;
static PyObject *__pyx_n_s_table_function_locals_decorator;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_threading;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_n_s_timeout;
static PyObject *__pyx_n_s_transaction;
static PyObject *__pyx_n_s_transactions;
static PyObject *__pyx_n_s_transform;
static PyObject *__pyx_n_s_unpack;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_kp_s_utf_8;
static PyObject *__pyx_n_s_uuid;
static PyObject *__pyx_n_s_uuid4;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_wal_autocheckpoint;
static PyObject *__pyx_n_s_where;
static PyObject *__pyx_n_s_where_2;
static PyObject *__pyx_n_s_with;
static PyObject *__pyx_n_s_wrap;
static int __pyx_pf_7sweepea_18_TableFunctionImpl___cinit__(struct __pyx_obj_7sweepea__TableFunctionImpl *__pyx_v_self, PyObject *__pyx_v_table_function); /* proto */
static void __pyx_pf_7sweepea_18_TableFunctionImpl_2__dealloc__(struct __pyx_obj_7sweepea__TableFunctionImpl *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_13TableFunction_register(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_conn); /* proto */
static PyObject *__pyx_pf_7sweepea_13TableFunction_2initialize(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_filters); /* proto */
static PyObject *__pyx_pf_7sweepea_13TableFunction_4iterate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_idx); /* proto */
static PyObject *__pyx_pf_7sweepea_13TableFunction_6get_table_columns_declaration(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls); /* proto */
static PyObject *__pyx_pf_7sweepea_murmurhash(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_seed); /* proto */
static PyObject *__pyx_pf_7sweepea_9make_hash_inner(PyObject *__pyx_self, PyObject *__pyx_v_items); /* proto */
static PyObject *__pyx_pf_7sweepea_2make_hash(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hash_impl); /* proto */
static int __pyx_pf_7sweepea_14ResultIterator___init__(struct __pyx_obj_7sweepea_ResultIterator *__pyx_v_self, struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_cursor_wrapper); /* proto */
static PyObject *__pyx_pf_7sweepea_14ResultIterator_2__next__(struct __pyx_obj_7sweepea_ResultIterator *__pyx_v_self); /* proto */
static int __pyx_pf_7sweepea_13CursorWrapper___init__(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self, PyObject *__pyx_v_cursor, PyObject *__pyx_v_transform); /* proto */
static PyObject *__pyx_pf_7sweepea_13CursorWrapper_2__iter__(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_7sweepea_13CursorWrapper_4__len__(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_13CursorWrapper_6iterator(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_13CursorWrapper_9__next__(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_13CursorWrapper_11fill_cache(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_7sweepea_4DictCursorWrapper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cursor); /* proto */
static PyObject *__pyx_pf_7sweepea_25_callable_context_manager_8__call___inner(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7sweepea_25_callable_context_manager___call__(struct __pyx_obj_7sweepea__callable_context_manager *__pyx_v_self, PyObject *__pyx_v_fn); /* proto */
static PyObject *__pyx_pf_7sweepea_10__status___getter(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_6__status__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_return_highwater); /* proto */
static PyObject *__pyx_pf_7sweepea_12__dbstatus___getter(PyObject *__pyx_self, struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8__dbstatus__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_return_highwater, PyObject *__pyx_v_return_current); /* proto */
static PyObject *__pyx_pf_7sweepea_10__pragma_____get__(PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_10__pragma___2__set__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7sweepea_10__pragma__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7sweepea_15ConnectionLocal___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static int __pyx_pf_7sweepea_8Database___init__(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_database, PyObject *__pyx_v_pragmas, PyObject *__pyx_v_journal_mode, PyObject *__pyx_v_rank_functions, PyObject *__pyx_v_regex_function, PyObject *__pyx_v_hash_functions, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_2init(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_database, PyObject *__pyx_v_connect_kwargs); /* proto */
static void __pyx_pf_7sweepea_8Database_4__dealloc__(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_6connect(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_8close(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_10initialize_connection(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_conn); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_12_create_aggregate(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_conn, PyObject *__pyx_v_klass, PyObject *__pyx_v_name, PyObject *__pyx_v_nparams); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_9aggregate_decorator(PyObject *__pyx_self, PyObject *__pyx_v_klass); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_14aggregate(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_9collation_decorator(PyObject *__pyx_self, PyObject *__pyx_v_fn); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_16collation(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_4func_decorator(PyObject *__pyx_self, PyObject *__pyx_v_fn); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_18func(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_n, PyObject *__pyx_v_deterministic); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_14table_function_decorator(PyObject *__pyx_self, PyObject *__pyx_v_klass); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_20table_function(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_22on_commit(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_fn); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_24_set_commit_hook(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_connection, PyObject *__pyx_v_fn); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_26on_rollback(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_fn); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_28_set_rollback_hook(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_connection, PyObject *__pyx_v_fn); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_30on_update(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_fn); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_32_set_update_hook(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_connection, PyObject *__pyx_v_fn); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_34is_closed(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_36execute_sql(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_params, PyObject *__pyx_v_commit); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_38execute(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_query); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_40sql(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_query); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_42pragma(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_44begin(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_lock_type); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_46commit(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_48rollback(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_50__getitem__(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_52__enter__(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_54__exit__(struct __pyx_obj_7sweepea_Database *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_14last_insert_id___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_10autocommit___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_8rowcount___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_56set_busy_handler(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_timeout); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_58atomic(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_60transaction(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_62savepoint(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_64get_tables(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_66get_indexes(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_68get_columns(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_70get_primary_keys(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_72get_foreign_keys(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_14connect_kwargs___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static int __pyx_pf_7sweepea_8Database_14connect_kwargs_2__set__(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7sweepea_8Database_14connect_kwargs_4__del__(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_8_pragmas___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static int __pyx_pf_7sweepea_8Database_8_pragmas_2__set__(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7sweepea_8Database_8_pragmas_4__del__(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_8database___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static int __pyx_pf_7sweepea_8Database_8database_2__set__(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7sweepea_8Database_8database_4__del__(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_8deferred___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_8Database_6_local___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self); /* proto */
static int __pyx_pf_7sweepea_7_atomic___init__(struct __pyx_obj_7sweepea__atomic *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_db); /* proto */
static PyObject *__pyx_pf_7sweepea_7_atomic_2__enter__(struct __pyx_obj_7sweepea__atomic *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_7_atomic_4__exit__(struct __pyx_obj_7sweepea__atomic *__pyx_v_self, PyObject *__pyx_v_exc_type, PyObject *__pyx_v_exc_val, PyObject *__pyx_v_exc_tb); /* proto */
static int __pyx_pf_7sweepea_12_transaction___init__(struct __pyx_obj_7sweepea__transaction *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_db, PyObject *__pyx_v_lock); /* proto */
static PyObject *__pyx_pf_7sweepea_12_transaction_2_begin(struct __pyx_obj_7sweepea__transaction *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_12_transaction_4commit(struct __pyx_obj_7sweepea__transaction *__pyx_v_self, int __pyx_v_begin); /* proto */
static PyObject *__pyx_pf_7sweepea_12_transaction_6rollback(struct __pyx_obj_7sweepea__transaction *__pyx_v_self, int __pyx_v_begin); /* proto */
static PyObject *__pyx_pf_7sweepea_12_transaction_8__enter__(struct __pyx_obj_7sweepea__transaction *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_12_transaction_10__exit__(struct __pyx_obj_7sweepea__transaction *__pyx_v_self, PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb); /* proto */
static int __pyx_pf_7sweepea_10_savepoint___init__(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_db, PyObject *__pyx_v_sid); /* proto */
static PyObject *__pyx_pf_7sweepea_10_savepoint_2_execute(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self, PyObject *__pyx_v_query); /* proto */
static PyObject *__pyx_pf_7sweepea_10_savepoint_4commit(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_10_savepoint_6rollback(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_10_savepoint_8__enter__(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_10_savepoint_10__exit__(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self, PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb); /* proto */
static int __pyx_pf_7sweepea_5State___cinit__(struct __pyx_obj_7sweepea_State *__pyx_v_self, PyObject *__pyx_v_scope, PyObject *__pyx_v_parentheses, PyObject *__pyx_v_subquery); /* proto */
static PyObject *__pyx_pf_7sweepea_5State_2__call__(struct __pyx_obj_7sweepea_State *__pyx_v_self, PyObject *__pyx_v_scope, PyObject *__pyx_v_parentheses, PyObject *__pyx_v_subquery); /* proto */
static PyObject *__pyx_pf_7sweepea_17__scope_context___inner(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7sweepea_12__scope_context__(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_scope); /* proto */
static int __pyx_pf_7sweepea_7Context___init__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_2__call__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_overrides); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_4__enter__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_6__exit__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_8sql(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_obj); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_10literal(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_sql); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_12parse(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_query); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_14query(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_11parentheses___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static int __pyx_pf_7sweepea_7Context_11parentheses_2__set__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7sweepea_7Context_11parentheses_4__del__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_8subquery___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static int __pyx_pf_7sweepea_7Context_8subquery_2__set__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7sweepea_7Context_8subquery_4__del__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_5scope___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static int __pyx_pf_7sweepea_7Context_5scope_2__set__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_5stack___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static int __pyx_pf_7sweepea_7Context_5stack_2__set__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7sweepea_7Context_5stack_4__del__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_4_sql___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static int __pyx_pf_7sweepea_7Context_4_sql_2__set__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7sweepea_7Context_4_sql_4__del__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_7_values___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static int __pyx_pf_7sweepea_7Context_7_values_2__set__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7sweepea_7Context_7_values_4__del__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_7Context_5state___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static int __pyx_pf_7sweepea_7Context_5state_2__set__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_7sweepea_7Context_5state_4__del__(struct __pyx_obj_7sweepea_Context *__pyx_v_self); /* proto */
static int __pyx_pf_7sweepea_13ColumnFactory___init__(struct __pyx_obj_7sweepea_ColumnFactory *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_7sweepea_13ColumnFactory_2__getattr__(struct __pyx_obj_7sweepea_ColumnFactory *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_pf_7sweepea_14_DynamicColumn___get__(struct __pyx_obj_7sweepea__DynamicColumn *__pyx_v_self, PyObject *__pyx_v_instance, CYTHON_UNUSED PyObject *__pyx_v_instance_type); /* proto */
static PyObject *__pyx_pf_7sweepea_15_ExplicitColumn___get__(struct __pyx_obj_7sweepea__ExplicitColumn *__pyx_v_self, PyObject *__pyx_v_instance, CYTHON_UNUSED PyObject *__pyx_v_instance_type); /* proto */
static PyObject *__pyx_pf_7sweepea_4Node_clone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_4Node_4copy_inner(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7sweepea_4Node_2copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_method); /* proto */
static PyObject *__pyx_pf_7sweepea_6Source___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_alias); /* proto */
static PyObject *__pyx_pf_7sweepea_6Source_2alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7sweepea_6Source_4select(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_selection); /* proto */
static PyObject *__pyx_pf_7sweepea_6Source_6join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_join_type, PyObject *__pyx_v_on); /* proto */
static PyObject *__pyx_pf_7sweepea_6Source_8left_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_on); /* proto */
static PyObject *__pyx_pf_7sweepea_6Source_10apply_alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_5Table___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_columns, PyObject *__pyx_v_schema, PyObject *__pyx_v_alias); /* proto */
static PyObject *__pyx_pf_7sweepea_5Table_2clone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_5Table_4select(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_selection); /* proto */
static PyObject *__pyx_pf_7sweepea_5Table_6insert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7sweepea_5Table_8update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data); /* proto */
static PyObject *__pyx_pf_7sweepea_5Table_10delete(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_5Table_12__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_4Join___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, PyObject *__pyx_v_join_type, PyObject *__pyx_v_on); /* proto */
static PyObject *__pyx_pf_7sweepea_4Join_2on(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_predicate); /* proto */
static PyObject *__pyx_pf_7sweepea_4Join_4__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_3CTE___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_query, PyObject *__pyx_v_recursive, PyObject *__pyx_v_columns); /* proto */
static PyObject *__pyx_pf_7sweepea_3CTE_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_10EntityBase_alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7sweepea_10EntityBase_2__inv__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_10EntityBase_4__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7sweepea_10EntityBase_6__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_7sweepea_10EntityBase_8__neg__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_10EntityBase_10__pos__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_10EntityBase_5__e___inner(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_7sweepea_10EntityBase_12__e__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_op, PyObject *__pyx_v_inv); /* proto */
static PyObject *__pyx_pf_7sweepea_10EntityBase_14is_null(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_is_null); /* proto */
static PyObject *__pyx_pf_7sweepea_10EntityBase_16between(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_lo, PyObject *__pyx_v_hi); /* proto */
static PyObject *__pyx_pf_7sweepea_10EntityBase_18asc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_10EntityBase_20desc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_5Value___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_7sweepea_5Value_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_6Column___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_table, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7sweepea_6Column_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_10Expression___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_op, PyObject *__pyx_v_rhs, PyObject *__pyx_v_is_flat); /* proto */
static PyObject *__pyx_pf_7sweepea_10Expression_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_13EntityWrapper___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_entity, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7sweepea_5Alias___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_entity, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7sweepea_5Alias_2alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
static PyObject *__pyx_pf_7sweepea_5Alias_4__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_7Negated___invert__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_7Negated_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_4Cast___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_entity, PyObject *__pyx_v_cast); /* proto */
static PyObject *__pyx_pf_7sweepea_4Cast_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_8Ordering___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_entity, PyObject *__pyx_v_direction, PyObject *__pyx_v_collation, PyObject *__pyx_v_nulls); /* proto */
static PyObject *__pyx_pf_7sweepea_8Ordering_2collate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_collation); /* proto */
static PyObject *__pyx_pf_7sweepea_8Ordering_4__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_14Asc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_entity, PyObject *__pyx_v_collation, PyObject *__pyx_v_nulls); /* proto */
static PyObject *__pyx_pf_7sweepea_16Desc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_entity, PyObject *__pyx_v_collation, PyObject *__pyx_v_nulls); /* proto */
static PyObject *__pyx_pf_7sweepea_6Entity_8__init___genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7sweepea_6Entity___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_path); /* proto */
static PyObject *__pyx_pf_7sweepea_6Entity_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_3SQL___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_params); /* proto */
static PyObject *__pyx_pf_7sweepea_3SQL_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_18Check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_constraint); /* proto */
static PyObject *__pyx_pf_7sweepea_8Function___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_arguments); /* proto */
static PyObject *__pyx_pf_7sweepea_8Function_11__getattr___decorator(PyObject *__pyx_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_7sweepea_8Function_2__getattr__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
static PyObject *__pyx_pf_7sweepea_8Function_4__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_4List___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nodes, PyObject *__pyx_v_glue, PyObject *__pyx_v_parentheses); /* proto */
static PyObject *__pyx_pf_7sweepea_4List_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_20CommaList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_nodes); /* proto */
static PyObject *__pyx_pf_7sweepea_22EnclosedList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_nodes); /* proto */
static PyObject *__pyx_pf_7sweepea_5Query___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_order_by, PyObject *__pyx_v_limit, PyObject *__pyx_v_offset, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7sweepea_5Query_2clone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_7sweepea_5Query_4with_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cte_list); /* proto */
static PyObject *__pyx_pf_7sweepea_5Query_6order_by(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_7sweepea_5Query_8order_by_extend(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_values); /* proto */
static PyObject *__pyx_pf_7sweepea_5Query_10limit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_limit); /* proto */
static PyObject *__pyx_pf_7sweepea_5Query_12offset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_offset); /* proto */
static PyObject *__pyx_pf_7sweepea_5Query_14paginate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_page, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_7sweepea_5Query_16apply_ordering(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_5Query_7__sql___genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_7sweepea_5Query_18__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_5Query_20execute(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_database); /* proto */
static PyObject *__pyx_pf_7sweepea_10SelectBase___add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_7sweepea_10SelectBase_2__or__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_7sweepea_10SelectBase_4__and__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_7sweepea_10SelectBase_6__sub__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_7sweepea_10SelectBase_8cte(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_recursive, PyObject *__pyx_v_columns); /* proto */
static PyObject *__pyx_pf_7sweepea_14CompoundSelect___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_op, PyObject *__pyx_v_rhs); /* proto */
static PyObject *__pyx_pf_7sweepea_14CompoundSelect_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_14CompoundSelect_4execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_database); /* proto */
static PyObject *__pyx_pf_7sweepea_6Select___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_from_clause, PyObject *__pyx_v_columns, PyObject *__pyx_v_where, PyObject *__pyx_v_group_by, PyObject *__pyx_v_having, PyObject *__pyx_v_order_by, PyObject *__pyx_v_limit, PyObject *__pyx_v_offset, PyObject *__pyx_v_distinct); /* proto */
static PyObject *__pyx_pf_7sweepea_6Select_2select(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_columns); /* proto */
static PyObject *__pyx_pf_7sweepea_6Select_4join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dest, PyObject *__pyx_v_join_type, PyObject *__pyx_v_on); /* proto */
static PyObject *__pyx_pf_7sweepea_6Select_6where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_expressions); /* proto */
static PyObject *__pyx_pf_7sweepea_6Select_8group_by(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_columns); /* proto */
static PyObject *__pyx_pf_7sweepea_6Select_10group_by_extend(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_columns); /* proto */
static PyObject *__pyx_pf_7sweepea_6Select_12having(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_expressions); /* proto */
static PyObject *__pyx_pf_7sweepea_6Select_14distinct(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_is_distinct); /* proto */
static PyObject *__pyx_pf_7sweepea_6Select_16dicts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_as_dict); /* proto */
static PyObject *__pyx_pf_7sweepea_6Select_18objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_as_object); /* proto */
static PyObject *__pyx_pf_7sweepea_6Select_20__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_6Select_22execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_database); /* proto */
static PyObject *__pyx_pf_7sweepea_10WriteQuery___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_table, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7sweepea_6Update___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_table, PyObject *__pyx_v_data, PyObject *__pyx_v_where, PyObject *__pyx_v_order_by, PyObject *__pyx_v_limit, PyObject *__pyx_v_offset, PyObject *__pyx_v_on_conflict); /* proto */
static PyObject *__pyx_pf_7sweepea_6Update_2where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_expressions); /* proto */
static PyObject *__pyx_pf_7sweepea_6Update_4on_conflict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_on_conflict); /* proto */
static PyObject *__pyx_pf_7sweepea_6Update_6__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_6Update_8execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_database); /* proto */
static PyObject *__pyx_pf_7sweepea_6Insert___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_table, PyObject *__pyx_v_data, PyObject *__pyx_v_columns, PyObject *__pyx_v_on_conflict); /* proto */
static PyObject *__pyx_pf_7sweepea_6Insert_2on_conflict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_on_conflict); /* proto */
static PyObject *__pyx_pf_7sweepea_6Insert_4_simple_insert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_6Insert_6_multi_insert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_6Insert_8_query_insert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_6Insert_10__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_6Insert_12execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_database); /* proto */
static PyObject *__pyx_pf_7sweepea_6Delete___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_table, PyObject *__pyx_v_where, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_7sweepea_6Delete_2where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_expressions); /* proto */
static PyObject *__pyx_pf_7sweepea_6Delete_4__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx); /* proto */
static PyObject *__pyx_pf_7sweepea_6Delete_6execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_database); /* proto */
static PyObject *__pyx_pf_7sweepea_24format_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date_value); /* proto */
static PyObject *__pyx_pf_7sweepea_26format_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date_value); /* proto */
static PyObject *__pyx_pf_7sweepea_28format_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time_value); /* proto */
static PyObject *__pyx_pf_11cfunc_dot_to_py_52__Pyx_CFunc_object____CursorWrapper____tuple___to_py_wrap(PyObject *__pyx_self, struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_cursor_wrapper, PyObject *__pyx_v_row); /* proto */
static PyObject *__pyx_pf_11cfunc_dot_to_py_62__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py_wrap(PyObject *__pyx_self, struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *__pyx_v_cursor_wrapper, PyObject *__pyx_v_row); /* proto */
static PyObject *__pyx_pf_11cfunc_dot_to_py_35__Pyx_CFunc_float____object___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_raw_match_info); /* proto */
static PyObject *__pyx_pf_11cfunc_dot_to_py_60__Pyx_CFunc_float____object____int____float____float___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_raw_match_info, int __pyx_v_column_index, float __pyx_v_k1, float __pyx_v_b); /* proto */
static PyObject *__pyx_pf_11cfunc_dot_to_py_52__Pyx_CFunc_bint____basestring____basestring___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_regex); /* proto */
static PyObject *__pyx_tp_new_7sweepea__TableFunctionImpl(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea_CursorWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea_ResultIterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea_NamedTupleCursorWrapper(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea__callable_context_manager(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea_Database(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea__atomic(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea__transaction(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea__savepoint(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea_State(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea_Context(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea_ColumnFactory(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea__DynamicColumn(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea__ExplicitColumn(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct__make_hash(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_1_iterator(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_2___call__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_3___status__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_4___dbstatus__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_5___pragma__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_6_aggregate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_7_collation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_8_func(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_9_table_function(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_10___scope_context__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_11_inner(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_12_copy(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_13___e__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_14___init__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_15_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_16___getattr__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_17___sql__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_18_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_float____object___to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items = {0, &__pyx_n_s_items, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyList_Type_pop = {0, &__pyx_n_s_pop, 0, 0, 0};
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_20;
static PyObject *__pyx_int_5000;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_k__46;
static PyObject *__pyx_k__48;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__9;
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__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__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__89;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_codeobj__8;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__128;
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__140;
static PyObject *__pyx_tuple__142;
static PyObject *__pyx_tuple__144;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__148;
static PyObject *__pyx_tuple__150;
static PyObject *__pyx_tuple__152;
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__168;
static PyObject *__pyx_tuple__170;
static PyObject *__pyx_tuple__172;
static PyObject *__pyx_tuple__174;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__177;
static PyObject *__pyx_tuple__179;
static PyObject *__pyx_tuple__181;
static PyObject *__pyx_tuple__183;
static PyObject *__pyx_tuple__185;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_tuple__189;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__192;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__199;
static PyObject *__pyx_tuple__201;
static PyObject *__pyx_tuple__203;
static PyObject *__pyx_tuple__205;
static PyObject *__pyx_tuple__207;
static PyObject *__pyx_tuple__209;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__211;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__213;
static PyObject *__pyx_tuple__214;
static PyObject *__pyx_tuple__215;
static PyObject *__pyx_tuple__216;
static PyObject *__pyx_tuple__218;
static PyObject *__pyx_tuple__219;
static PyObject *__pyx_tuple__221;
static PyObject *__pyx_tuple__223;
static PyObject *__pyx_tuple__225;
static PyObject *__pyx_tuple__227;
static PyObject *__pyx_tuple__229;
static PyObject *__pyx_tuple__231;
static PyObject *__pyx_tuple__233;
static PyObject *__pyx_tuple__235;
static PyObject *__pyx_tuple__236;
static PyObject *__pyx_tuple__238;
static PyObject *__pyx_tuple__240;
static PyObject *__pyx_tuple__242;
static PyObject *__pyx_tuple__244;
static PyObject *__pyx_tuple__246;
static PyObject *__pyx_tuple__248;
static PyObject *__pyx_tuple__250;
static PyObject *__pyx_tuple__252;
static PyObject *__pyx_tuple__254;
static PyObject *__pyx_tuple__256;
static PyObject *__pyx_tuple__257;
static PyObject *__pyx_tuple__259;
static PyObject *__pyx_tuple__260;
static PyObject *__pyx_tuple__262;
static PyObject *__pyx_tuple__264;
static PyObject *__pyx_tuple__266;
static PyObject *__pyx_tuple__268;
static PyObject *__pyx_tuple__270;
static PyObject *__pyx_tuple__272;
static PyObject *__pyx_tuple__273;
static PyObject *__pyx_tuple__275;
static PyObject *__pyx_tuple__277;
static PyObject *__pyx_tuple__279;
static PyObject *__pyx_tuple__281;
static PyObject *__pyx_tuple__283;
static PyObject *__pyx_tuple__284;
static PyObject *__pyx_tuple__286;
static PyObject *__pyx_tuple__287;
static PyObject *__pyx_tuple__289;
static PyObject *__pyx_tuple__291;
static PyObject *__pyx_tuple__293;
static PyObject *__pyx_tuple__295;
static PyObject *__pyx_tuple__296;
static PyObject *__pyx_tuple__298;
static PyObject *__pyx_tuple__300;
static PyObject *__pyx_tuple__302;
static PyObject *__pyx_tuple__304;
static PyObject *__pyx_tuple__306;
static PyObject *__pyx_tuple__307;
static PyObject *__pyx_tuple__309;
static PyObject *__pyx_tuple__310;
static PyObject *__pyx_tuple__312;
static PyObject *__pyx_tuple__313;
static PyObject *__pyx_tuple__315;
static PyObject *__pyx_tuple__317;
static PyObject *__pyx_tuple__319;
static PyObject *__pyx_tuple__321;
static PyObject *__pyx_tuple__323;
static PyObject *__pyx_tuple__325;
static PyObject *__pyx_tuple__327;
static PyObject *__pyx_tuple__329;
static PyObject *__pyx_tuple__330;
static PyObject *__pyx_tuple__332;
static PyObject *__pyx_tuple__334;
static PyObject *__pyx_tuple__336;
static PyObject *__pyx_tuple__338;
static PyObject *__pyx_tuple__339;
static PyObject *__pyx_tuple__341;
static PyObject *__pyx_tuple__343;
static PyObject *__pyx_tuple__344;
static PyObject *__pyx_tuple__346;
static PyObject *__pyx_tuple__348;
static PyObject *__pyx_tuple__350;
static PyObject *__pyx_tuple__352;
static PyObject *__pyx_tuple__354;
static PyObject *__pyx_tuple__355;
static PyObject *__pyx_tuple__357;
static PyObject *__pyx_tuple__358;
static PyObject *__pyx_tuple__360;
static PyObject *__pyx_tuple__361;
static PyObject *__pyx_tuple__363;
static PyObject *__pyx_tuple__365;
static PyObject *__pyx_tuple__367;
static PyObject *__pyx_tuple__369;
static PyObject *__pyx_tuple__370;
static PyObject *__pyx_tuple__372;
static PyObject *__pyx_tuple__374;
static PyObject *__pyx_tuple__376;
static PyObject *__pyx_tuple__378;
static PyObject *__pyx_tuple__380;
static PyObject *__pyx_tuple__381;
static PyObject *__pyx_tuple__383;
static PyObject *__pyx_tuple__385;
static PyObject *__pyx_tuple__387;
static PyObject *__pyx_tuple__389;
static PyObject *__pyx_tuple__391;
static PyObject *__pyx_tuple__393;
static PyObject *__pyx_tuple__395;
static PyObject *__pyx_tuple__396;
static PyObject *__pyx_tuple__398;
static PyObject *__pyx_tuple__400;
static PyObject *__pyx_tuple__402;
static PyObject *__pyx_tuple__403;
static PyObject *__pyx_tuple__404;
static PyObject *__pyx_codeobj__12;
static PyObject *__pyx_codeobj__14;
static PyObject *__pyx_codeobj__16;
static PyObject *__pyx_codeobj__18;
static PyObject *__pyx_codeobj__20;
static PyObject *__pyx_codeobj__38;
static PyObject *__pyx_codeobj__40;
static PyObject *__pyx_codeobj__43;
static PyObject *__pyx_codeobj__45;
static PyObject *__pyx_codeobj__51;
static PyObject *__pyx_codeobj__56;
static PyObject *__pyx_codeobj__62;
static PyObject *__pyx_codeobj__70;
static PyObject *__pyx_codeobj__88;
static PyObject *__pyx_codeobj__90;
static PyObject *__pyx_codeobj__92;
static PyObject *__pyx_codeobj__94;
static PyObject *__pyx_codeobj__96;
static PyObject *__pyx_codeobj__98;
static PyObject *__pyx_codeobj__100;
static PyObject *__pyx_codeobj__102;
static PyObject *__pyx_codeobj__104;
static PyObject *__pyx_codeobj__106;
static PyObject *__pyx_codeobj__108;
static PyObject *__pyx_codeobj__110;
static PyObject *__pyx_codeobj__112;
static PyObject *__pyx_codeobj__114;
static PyObject *__pyx_codeobj__116;
static PyObject *__pyx_codeobj__118;
static PyObject *__pyx_codeobj__129;
static PyObject *__pyx_codeobj__131;
static PyObject *__pyx_codeobj__133;
static PyObject *__pyx_codeobj__135;
static PyObject *__pyx_codeobj__138;
static PyObject *__pyx_codeobj__141;
static PyObject *__pyx_codeobj__143;
static PyObject *__pyx_codeobj__146;
static PyObject *__pyx_codeobj__149;
static PyObject *__pyx_codeobj__151;
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__169;
static PyObject *__pyx_codeobj__171;
static PyObject *__pyx_codeobj__173;
static PyObject *__pyx_codeobj__176;
static PyObject *__pyx_codeobj__178;
static PyObject *__pyx_codeobj__180;
static PyObject *__pyx_codeobj__182;
static PyObject *__pyx_codeobj__184;
static PyObject *__pyx_codeobj__186;
static PyObject *__pyx_codeobj__188;
static PyObject *__pyx_codeobj__190;
static PyObject *__pyx_codeobj__217;
static PyObject *__pyx_codeobj__220;
static PyObject *__pyx_codeobj__222;
static PyObject *__pyx_codeobj__224;
static PyObject *__pyx_codeobj__226;
static PyObject *__pyx_codeobj__228;
static PyObject *__pyx_codeobj__230;
static PyObject *__pyx_codeobj__232;
static PyObject *__pyx_codeobj__234;
static PyObject *__pyx_codeobj__237;
static PyObject *__pyx_codeobj__239;
static PyObject *__pyx_codeobj__241;
static PyObject *__pyx_codeobj__243;
static PyObject *__pyx_codeobj__245;
static PyObject *__pyx_codeobj__247;
static PyObject *__pyx_codeobj__249;
static PyObject *__pyx_codeobj__251;
static PyObject *__pyx_codeobj__253;
static PyObject *__pyx_codeobj__255;
static PyObject *__pyx_codeobj__258;
static PyObject *__pyx_codeobj__261;
static PyObject *__pyx_codeobj__263;
static PyObject *__pyx_codeobj__265;
static PyObject *__pyx_codeobj__267;
static PyObject *__pyx_codeobj__269;
static PyObject *__pyx_codeobj__271;
static PyObject *__pyx_codeobj__274;
static PyObject *__pyx_codeobj__276;
static PyObject *__pyx_codeobj__278;
static PyObject *__pyx_codeobj__280;
static PyObject *__pyx_codeobj__282;
static PyObject *__pyx_codeobj__285;
static PyObject *__pyx_codeobj__288;
static PyObject *__pyx_codeobj__290;
static PyObject *__pyx_codeobj__292;
static PyObject *__pyx_codeobj__294;
static PyObject *__pyx_codeobj__297;
static PyObject *__pyx_codeobj__299;
static PyObject *__pyx_codeobj__301;
static PyObject *__pyx_codeobj__303;
static PyObject *__pyx_codeobj__305;
static PyObject *__pyx_codeobj__308;
static PyObject *__pyx_codeobj__311;
static PyObject *__pyx_codeobj__314;
static PyObject *__pyx_codeobj__316;
static PyObject *__pyx_codeobj__318;
static PyObject *__pyx_codeobj__320;
static PyObject *__pyx_codeobj__322;
static PyObject *__pyx_codeobj__324;
static PyObject *__pyx_codeobj__326;
static PyObject *__pyx_codeobj__328;
static PyObject *__pyx_codeobj__331;
static PyObject *__pyx_codeobj__333;
static PyObject *__pyx_codeobj__335;
static PyObject *__pyx_codeobj__337;
static PyObject *__pyx_codeobj__340;
static PyObject *__pyx_codeobj__342;
static PyObject *__pyx_codeobj__345;
static PyObject *__pyx_codeobj__347;
static PyObject *__pyx_codeobj__349;
static PyObject *__pyx_codeobj__351;
static PyObject *__pyx_codeobj__353;
static PyObject *__pyx_codeobj__356;
static PyObject *__pyx_codeobj__359;
static PyObject *__pyx_codeobj__362;
static PyObject *__pyx_codeobj__364;
static PyObject *__pyx_codeobj__366;
static PyObject *__pyx_codeobj__368;
static PyObject *__pyx_codeobj__371;
static PyObject *__pyx_codeobj__373;
static PyObject *__pyx_codeobj__375;
static PyObject *__pyx_codeobj__377;
static PyObject *__pyx_codeobj__379;
static PyObject *__pyx_codeobj__382;
static PyObject *__pyx_codeobj__384;
static PyObject *__pyx_codeobj__386;
static PyObject *__pyx_codeobj__388;
static PyObject *__pyx_codeobj__390;
static PyObject *__pyx_codeobj__392;
static PyObject *__pyx_codeobj__394;
static PyObject *__pyx_codeobj__397;
static PyObject *__pyx_codeobj__399;
static PyObject *__pyx_codeobj__401;

/* "sweepea.pyx":255
 * # We define an xConnect function, but leave xCreate NULL so that the
 * # table-function can be called eponymously.
 * cdef int pwConnect(sqlite3 *db, void *pAux, int argc, char **argv,             # <<<<<<<<<<<<<<
 *                    sqlite3_vtab **ppVtab, char **pzErr) with gil:
 *     cdef:
 */

static int __pyx_f_7sweepea_pwConnect(sqlite3 *__pyx_v_db, void *__pyx_v_pAux, CYTHON_UNUSED int __pyx_v_argc, CYTHON_UNUSED char **__pyx_v_argv, sqlite3_vtab **__pyx_v_ppVtab, CYTHON_UNUSED char **__pyx_v_pzErr) {
  int __pyx_v_rc;
  PyObject *__pyx_v_table_func_cls = 0;
  __pyx_t_7sweepea_peewee_vtab *__pyx_v_pNew;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  char const *__pyx_t_4;
  int __pyx_t_5;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("pwConnect", 0);

  /* "sweepea.pyx":259
 *     cdef:
 *         int rc
 *         object table_func_cls = <object>pAux             # <<<<<<<<<<<<<<
 *         peewee_vtab *pNew
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_pAux);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_table_func_cls = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":264
 *     rc = sqlite3_declare_vtab(
 *         db,
 *         'CREATE TABLE x(%s);' % table_func_cls.get_table_columns_declaration())             # <<<<<<<<<<<<<<
 *     if rc == SQLITE_OK:
 *         pNew = <peewee_vtab *>sqlite3_malloc(sizeof(pNew[0]))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_table_func_cls, __pyx_n_s_get_table_columns_declaration); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 264, __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, 264, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_CREATE_TABLE_x_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 264, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error)

  /* "sweepea.pyx":262
 *         peewee_vtab *pNew
 * 
 *     rc = sqlite3_declare_vtab(             # <<<<<<<<<<<<<<
 *         db,
 *         'CREATE TABLE x(%s);' % table_func_cls.get_table_columns_declaration())
 */
  __pyx_v_rc = sqlite3_declare_vtab(__pyx_v_db, __pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":265
 *         db,
 *         'CREATE TABLE x(%s);' % table_func_cls.get_table_columns_declaration())
 *     if rc == SQLITE_OK:             # <<<<<<<<<<<<<<
 *         pNew = <peewee_vtab *>sqlite3_malloc(sizeof(pNew[0]))
 *         memset(<char *>pNew, 0, sizeof(pNew[0]))
 */
  __pyx_t_5 = ((__pyx_v_rc == SQLITE_OK) != 0);
  if (__pyx_t_5) {

    /* "sweepea.pyx":266
 *         'CREATE TABLE x(%s);' % table_func_cls.get_table_columns_declaration())
 *     if rc == SQLITE_OK:
 *         pNew = <peewee_vtab *>sqlite3_malloc(sizeof(pNew[0]))             # <<<<<<<<<<<<<<
 *         memset(<char *>pNew, 0, sizeof(pNew[0]))
 *         ppVtab[0] = &(pNew.base)
 */
    __pyx_v_pNew = ((__pyx_t_7sweepea_peewee_vtab *)sqlite3_malloc((sizeof((__pyx_v_pNew[0])))));

    /* "sweepea.pyx":267
 *     if rc == SQLITE_OK:
 *         pNew = <peewee_vtab *>sqlite3_malloc(sizeof(pNew[0]))
 *         memset(<char *>pNew, 0, sizeof(pNew[0]))             # <<<<<<<<<<<<<<
 *         ppVtab[0] = &(pNew.base)
 * 
 */
    memset(((char *)__pyx_v_pNew), 0, (sizeof((__pyx_v_pNew[0]))));

    /* "sweepea.pyx":268
 *         pNew = <peewee_vtab *>sqlite3_malloc(sizeof(pNew[0]))
 *         memset(<char *>pNew, 0, sizeof(pNew[0]))
 *         ppVtab[0] = &(pNew.base)             # <<<<<<<<<<<<<<
 * 
 *         pNew.table_func_cls = <void *>table_func_cls
 */
    (__pyx_v_ppVtab[0]) = (&__pyx_v_pNew->base);

    /* "sweepea.pyx":270
 *         ppVtab[0] = &(pNew.base)
 * 
 *         pNew.table_func_cls = <void *>table_func_cls             # <<<<<<<<<<<<<<
 *         Py_INCREF(table_func_cls)
 * 
 */
    __pyx_v_pNew->table_func_cls = ((void *)__pyx_v_table_func_cls);

    /* "sweepea.pyx":271
 * 
 *         pNew.table_func_cls = <void *>table_func_cls
 *         Py_INCREF(table_func_cls)             # <<<<<<<<<<<<<<
 * 
 *     return rc
 */
    Py_INCREF(__pyx_v_table_func_cls);

    /* "sweepea.pyx":265
 *         db,
 *         'CREATE TABLE x(%s);' % table_func_cls.get_table_columns_declaration())
 *     if rc == SQLITE_OK:             # <<<<<<<<<<<<<<
 *         pNew = <peewee_vtab *>sqlite3_malloc(sizeof(pNew[0]))
 *         memset(<char *>pNew, 0, sizeof(pNew[0]))
 */
  }

  /* "sweepea.pyx":273
 *         Py_INCREF(table_func_cls)
 * 
 *     return rc             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_rc;
  goto __pyx_L0;

  /* "sweepea.pyx":255
 * # We define an xConnect function, but leave xCreate NULL so that the
 * # table-function can be called eponymously.
 * cdef int pwConnect(sqlite3 *db, void *pAux, int argc, char **argv,             # <<<<<<<<<<<<<<
 *                    sqlite3_vtab **ppVtab, char **pzErr) with gil:
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("sweepea.pwConnect", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_func_cls);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "sweepea.pyx":276
 * 
 * 
 * cdef int pwDisconnect(sqlite3_vtab *pBase) with gil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         peewee_vtab *pVtab = <peewee_vtab *>pBase
 */

static int __pyx_f_7sweepea_pwDisconnect(sqlite3_vtab *__pyx_v_pBase) {
  __pyx_t_7sweepea_peewee_vtab *__pyx_v_pVtab;
  PyObject *__pyx_v_table_func_cls = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("pwDisconnect", 0);

  /* "sweepea.pyx":278
 * cdef int pwDisconnect(sqlite3_vtab *pBase) with gil:
 *     cdef:
 *         peewee_vtab *pVtab = <peewee_vtab *>pBase             # <<<<<<<<<<<<<<
 *         object table_func_cls = <object>(pVtab.table_func_cls)
 * 
 */
  __pyx_v_pVtab = ((__pyx_t_7sweepea_peewee_vtab *)__pyx_v_pBase);

  /* "sweepea.pyx":279
 *     cdef:
 *         peewee_vtab *pVtab = <peewee_vtab *>pBase
 *         object table_func_cls = <object>(pVtab.table_func_cls)             # <<<<<<<<<<<<<<
 * 
 *     Py_DECREF(table_func_cls)
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_pVtab->table_func_cls);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_table_func_cls = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":281
 *         object table_func_cls = <object>(pVtab.table_func_cls)
 * 
 *     Py_DECREF(table_func_cls)             # <<<<<<<<<<<<<<
 *     sqlite3_free(pVtab)
 *     return SQLITE_OK
 */
  Py_DECREF(__pyx_v_table_func_cls);

  /* "sweepea.pyx":282
 * 
 *     Py_DECREF(table_func_cls)
 *     sqlite3_free(pVtab)             # <<<<<<<<<<<<<<
 *     return SQLITE_OK
 * 
 */
  sqlite3_free(__pyx_v_pVtab);

  /* "sweepea.pyx":283
 *     Py_DECREF(table_func_cls)
 *     sqlite3_free(pVtab)
 *     return SQLITE_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = SQLITE_OK;
  goto __pyx_L0;

  /* "sweepea.pyx":276
 * 
 * 
 * cdef int pwDisconnect(sqlite3_vtab *pBase) with gil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         peewee_vtab *pVtab = <peewee_vtab *>pBase
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_func_cls);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "sweepea.pyx":288
 * # The xOpen method is used to initialize a cursor. In this method we
 * # instantiate the TableFunction class and zero out a new cursor for iteration.
 * cdef int pwOpen(sqlite3_vtab *pBase, sqlite3_vtab_cursor **ppCursor) with gil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         peewee_vtab *pVtab = <peewee_vtab *>pBase
 */

static int __pyx_f_7sweepea_pwOpen(sqlite3_vtab *__pyx_v_pBase, sqlite3_vtab_cursor **__pyx_v_ppCursor) {
  __pyx_t_7sweepea_peewee_vtab *__pyx_v_pVtab;
  __pyx_t_7sweepea_peewee_cursor *__pyx_v_pCur;
  PyObject *__pyx_v_table_func_cls = 0;
  PyObject *__pyx_v_table_func = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("pwOpen", 0);

  /* "sweepea.pyx":290
 * cdef int pwOpen(sqlite3_vtab *pBase, sqlite3_vtab_cursor **ppCursor) with gil:
 *     cdef:
 *         peewee_vtab *pVtab = <peewee_vtab *>pBase             # <<<<<<<<<<<<<<
 *         peewee_cursor *pCur
 *         object table_func_cls = <object>pVtab.table_func_cls
 */
  __pyx_v_pVtab = ((__pyx_t_7sweepea_peewee_vtab *)__pyx_v_pBase);

  /* "sweepea.pyx":292
 *         peewee_vtab *pVtab = <peewee_vtab *>pBase
 *         peewee_cursor *pCur
 *         object table_func_cls = <object>pVtab.table_func_cls             # <<<<<<<<<<<<<<
 * 
 *     pCur = <peewee_cursor *>sqlite3_malloc(sizeof(pCur[0]))
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_pVtab->table_func_cls);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_table_func_cls = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":294
 *         object table_func_cls = <object>pVtab.table_func_cls
 * 
 *     pCur = <peewee_cursor *>sqlite3_malloc(sizeof(pCur[0]))             # <<<<<<<<<<<<<<
 *     memset(<char *>pCur, 0, sizeof(pCur[0]))
 *     ppCursor[0] = &(pCur.base)
 */
  __pyx_v_pCur = ((__pyx_t_7sweepea_peewee_cursor *)sqlite3_malloc((sizeof((__pyx_v_pCur[0])))));

  /* "sweepea.pyx":295
 * 
 *     pCur = <peewee_cursor *>sqlite3_malloc(sizeof(pCur[0]))
 *     memset(<char *>pCur, 0, sizeof(pCur[0]))             # <<<<<<<<<<<<<<
 *     ppCursor[0] = &(pCur.base)
 *     pCur.idx = 0
 */
  memset(((char *)__pyx_v_pCur), 0, (sizeof((__pyx_v_pCur[0]))));

  /* "sweepea.pyx":296
 *     pCur = <peewee_cursor *>sqlite3_malloc(sizeof(pCur[0]))
 *     memset(<char *>pCur, 0, sizeof(pCur[0]))
 *     ppCursor[0] = &(pCur.base)             # <<<<<<<<<<<<<<
 *     pCur.idx = 0
 *     table_func = table_func_cls()
 */
  (__pyx_v_ppCursor[0]) = (&__pyx_v_pCur->base);

  /* "sweepea.pyx":297
 *     memset(<char *>pCur, 0, sizeof(pCur[0]))
 *     ppCursor[0] = &(pCur.base)
 *     pCur.idx = 0             # <<<<<<<<<<<<<<
 *     table_func = table_func_cls()
 *     Py_INCREF(table_func)
 */
  __pyx_v_pCur->idx = 0;

  /* "sweepea.pyx":298
 *     ppCursor[0] = &(pCur.base)
 *     pCur.idx = 0
 *     table_func = table_func_cls()             # <<<<<<<<<<<<<<
 *     Py_INCREF(table_func)
 *     pCur.table_func = <void *>table_func
 */
  __Pyx_INCREF(__pyx_v_table_func_cls);
  __pyx_t_2 = __pyx_v_table_func_cls; __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 298, __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, 298, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_table_func = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":299
 *     pCur.idx = 0
 *     table_func = table_func_cls()
 *     Py_INCREF(table_func)             # <<<<<<<<<<<<<<
 *     pCur.table_func = <void *>table_func
 *     pCur.stopped = False
 */
  Py_INCREF(__pyx_v_table_func);

  /* "sweepea.pyx":300
 *     table_func = table_func_cls()
 *     Py_INCREF(table_func)
 *     pCur.table_func = <void *>table_func             # <<<<<<<<<<<<<<
 *     pCur.stopped = False
 *     return SQLITE_OK
 */
  __pyx_v_pCur->table_func = ((void *)__pyx_v_table_func);

  /* "sweepea.pyx":301
 *     Py_INCREF(table_func)
 *     pCur.table_func = <void *>table_func
 *     pCur.stopped = False             # <<<<<<<<<<<<<<
 *     return SQLITE_OK
 * 
 */
  __pyx_v_pCur->stopped = 0;

  /* "sweepea.pyx":302
 *     pCur.table_func = <void *>table_func
 *     pCur.stopped = False
 *     return SQLITE_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = SQLITE_OK;
  goto __pyx_L0;

  /* "sweepea.pyx":288
 * # The xOpen method is used to initialize a cursor. In this method we
 * # instantiate the TableFunction class and zero out a new cursor for iteration.
 * cdef int pwOpen(sqlite3_vtab *pBase, sqlite3_vtab_cursor **ppCursor) with gil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         peewee_vtab *pVtab = <peewee_vtab *>pBase
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("sweepea.pwOpen", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_func_cls);
  __Pyx_XDECREF(__pyx_v_table_func);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "sweepea.pyx":305
 * 
 * 
 * cdef int pwClose(sqlite3_vtab_cursor *pBase) with gil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 */

static int __pyx_f_7sweepea_pwClose(sqlite3_vtab_cursor *__pyx_v_pBase) {
  __pyx_t_7sweepea_peewee_cursor *__pyx_v_pCur;
  PyObject *__pyx_v_table_func = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("pwClose", 0);

  /* "sweepea.pyx":307
 * cdef int pwClose(sqlite3_vtab_cursor *pBase) with gil:
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase             # <<<<<<<<<<<<<<
 *         object table_func = <object>pCur.table_func
 *     Py_DECREF(table_func)
 */
  __pyx_v_pCur = ((__pyx_t_7sweepea_peewee_cursor *)__pyx_v_pBase);

  /* "sweepea.pyx":308
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 *         object table_func = <object>pCur.table_func             # <<<<<<<<<<<<<<
 *     Py_DECREF(table_func)
 *     sqlite3_free(pCur)
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_pCur->table_func);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_table_func = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":309
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 *         object table_func = <object>pCur.table_func
 *     Py_DECREF(table_func)             # <<<<<<<<<<<<<<
 *     sqlite3_free(pCur)
 *     return SQLITE_OK
 */
  Py_DECREF(__pyx_v_table_func);

  /* "sweepea.pyx":310
 *         object table_func = <object>pCur.table_func
 *     Py_DECREF(table_func)
 *     sqlite3_free(pCur)             # <<<<<<<<<<<<<<
 *     return SQLITE_OK
 * 
 */
  sqlite3_free(__pyx_v_pCur);

  /* "sweepea.pyx":311
 *     Py_DECREF(table_func)
 *     sqlite3_free(pCur)
 *     return SQLITE_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = SQLITE_OK;
  goto __pyx_L0;

  /* "sweepea.pyx":305
 * 
 * 
 * cdef int pwClose(sqlite3_vtab_cursor *pBase) with gil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_func);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "sweepea.pyx":316
 * # Iterate once, advancing the cursor's index and assigning the row data to the
 * # `row_data` field on the peewee_cursor struct.
 * cdef int pwNext(sqlite3_vtab_cursor *pBase) with gil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 */

static int __pyx_f_7sweepea_pwNext(sqlite3_vtab_cursor *__pyx_v_pBase) {
  __pyx_t_7sweepea_peewee_cursor *__pyx_v_pCur;
  PyObject *__pyx_v_table_func = 0;
  PyObject *__pyx_v_result = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("pwNext", 0);

  /* "sweepea.pyx":318
 * cdef int pwNext(sqlite3_vtab_cursor *pBase) with gil:
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase             # <<<<<<<<<<<<<<
 *         object table_func = <object>pCur.table_func
 *         tuple result
 */
  __pyx_v_pCur = ((__pyx_t_7sweepea_peewee_cursor *)__pyx_v_pBase);

  /* "sweepea.pyx":319
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 *         object table_func = <object>pCur.table_func             # <<<<<<<<<<<<<<
 *         tuple result
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_pCur->table_func);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_table_func = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":322
 *         tuple result
 * 
 *     if pCur.row_data:             # <<<<<<<<<<<<<<
 *         Py_DECREF(<tuple>pCur.row_data)
 * 
 */
  __pyx_t_2 = (__pyx_v_pCur->row_data != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":323
 * 
 *     if pCur.row_data:
 *         Py_DECREF(<tuple>pCur.row_data)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_1 = ((PyObject *)__pyx_v_pCur->row_data);
    __Pyx_INCREF(__pyx_t_1);
    Py_DECREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":322
 *         tuple result
 * 
 *     if pCur.row_data:             # <<<<<<<<<<<<<<
 *         Py_DECREF(<tuple>pCur.row_data)
 * 
 */
  }

  /* "sweepea.pyx":325
 *         Py_DECREF(<tuple>pCur.row_data)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         result = table_func.iterate(pCur.idx)
 *     except StopIteration:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "sweepea.pyx":326
 * 
 *     try:
 *         result = table_func.iterate(pCur.idx)             # <<<<<<<<<<<<<<
 *     except StopIteration:
 *         pCur.stopped = True
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_table_func, __pyx_n_s_iterate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 326, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_pCur->idx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 326, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && 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, 326, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 326, __pyx_L4_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, 326, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 326, __pyx_L4_error)
      __pyx_v_result = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "sweepea.pyx":325
 *         Py_DECREF(<tuple>pCur.row_data)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         result = table_func.iterate(pCur.idx)
 *     except StopIteration:
 */
    }

    /* "sweepea.pyx":332
 *         return SQLITE_ERROR
 *     else:
 *         Py_INCREF(result)             # <<<<<<<<<<<<<<
 *         pCur.row_data = <void *>result
 *         pCur.idx += 1
 */
    /*else:*/ {
      Py_INCREF(__pyx_v_result);

      /* "sweepea.pyx":333
 *     else:
 *         Py_INCREF(result)
 *         pCur.row_data = <void *>result             # <<<<<<<<<<<<<<
 *         pCur.idx += 1
 *         pCur.stopped = False
 */
      __pyx_v_pCur->row_data = ((void *)__pyx_v_result);

      /* "sweepea.pyx":334
 *         Py_INCREF(result)
 *         pCur.row_data = <void *>result
 *         pCur.idx += 1             # <<<<<<<<<<<<<<
 *         pCur.stopped = False
 * 
 */
      __pyx_v_pCur->idx = (__pyx_v_pCur->idx + 1);

      /* "sweepea.pyx":335
 *         pCur.row_data = <void *>result
 *         pCur.idx += 1
 *         pCur.stopped = False             # <<<<<<<<<<<<<<
 * 
 *     return SQLITE_OK
 */
      __pyx_v_pCur->stopped = 0;
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L11_try_end;
    __pyx_L4_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":327
 *     try:
 *         result = table_func.iterate(pCur.idx)
 *     except StopIteration:             # <<<<<<<<<<<<<<
 *         pCur.stopped = True
 *     except:
 */
    __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
    if (__pyx_t_10) {
      __Pyx_AddTraceback("sweepea.pwNext", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_6, &__pyx_t_9) < 0) __PYX_ERR(0, 327, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_9);

      /* "sweepea.pyx":328
 *         result = table_func.iterate(pCur.idx)
 *     except StopIteration:
 *         pCur.stopped = True             # <<<<<<<<<<<<<<
 *     except:
 *         return SQLITE_ERROR
 */
      __pyx_v_pCur->stopped = 1;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L5_exception_handled;
    }

    /* "sweepea.pyx":329
 *     except StopIteration:
 *         pCur.stopped = True
 *     except:             # <<<<<<<<<<<<<<
 *         return SQLITE_ERROR
 *     else:
 */
    /*except:*/ {
      __Pyx_AddTraceback("sweepea.pwNext", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_6, &__pyx_t_1) < 0) __PYX_ERR(0, 329, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_1);

      /* "sweepea.pyx":330
 *         pCur.stopped = True
 *     except:
 *         return SQLITE_ERROR             # <<<<<<<<<<<<<<
 *     else:
 *         Py_INCREF(result)
 */
      __pyx_r = SQLITE_ERROR;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L7_except_return;
    }
    __pyx_L6_except_error:;

    /* "sweepea.pyx":325
 *         Py_DECREF(<tuple>pCur.row_data)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         result = table_func.iterate(pCur.idx)
 *     except StopIteration:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L7_except_return:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L0;
    __pyx_L5_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    __pyx_L11_try_end:;
  }

  /* "sweepea.pyx":337
 *         pCur.stopped = False
 * 
 *     return SQLITE_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = SQLITE_OK;
  goto __pyx_L0;

  /* "sweepea.pyx":316
 * # Iterate once, advancing the cursor's index and assigning the row data to the
 * # `row_data` field on the peewee_cursor struct.
 * cdef int pwNext(sqlite3_vtab_cursor *pBase) with gil:             # <<<<<<<<<<<<<<
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("sweepea.pwNext", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_func);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "sweepea.pyx":341
 * 
 * # Return the requested column from the current row.
 * cdef int pwColumn(sqlite3_vtab_cursor *pBase, sqlite3_context *ctx,             # <<<<<<<<<<<<<<
 *                   int iCol) with gil:
 *     cdef:
 */

static int __pyx_f_7sweepea_pwColumn(sqlite3_vtab_cursor *__pyx_v_pBase, sqlite3_context *__pyx_v_ctx, int __pyx_v_iCol) {
  __pyx_t_7sweepea_peewee_cursor *__pyx_v_pCur;
  CYTHON_UNUSED sqlite3_int64 __pyx_v_x;
  PyObject *__pyx_v_row_data = 0;
  PyObject *__pyx_v_value = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  sqlite3_int64 __pyx_t_5;
  double __pyx_t_6;
  char const *__pyx_t_7;
  int __pyx_t_8;
  char const *__pyx_t_9;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("pwColumn", 0);

  /* "sweepea.pyx":344
 *                   int iCol) with gil:
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase             # <<<<<<<<<<<<<<
 *         sqlite3_int64 x = 0
 *         tuple row_data
 */
  __pyx_v_pCur = ((__pyx_t_7sweepea_peewee_cursor *)__pyx_v_pBase);

  /* "sweepea.pyx":345
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 *         sqlite3_int64 x = 0             # <<<<<<<<<<<<<<
 *         tuple row_data
 * 
 */
  __pyx_v_x = 0;

  /* "sweepea.pyx":348
 *         tuple row_data
 * 
 *     if iCol == -1:             # <<<<<<<<<<<<<<
 *         sqlite3_result_int64(ctx, <sqlite3_int64>pCur.idx)
 *         return SQLITE_OK
 */
  __pyx_t_1 = ((__pyx_v_iCol == -1L) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":349
 * 
 *     if iCol == -1:
 *         sqlite3_result_int64(ctx, <sqlite3_int64>pCur.idx)             # <<<<<<<<<<<<<<
 *         return SQLITE_OK
 * 
 */
    sqlite3_result_int64(__pyx_v_ctx, ((sqlite3_int64)__pyx_v_pCur->idx));

    /* "sweepea.pyx":350
 *     if iCol == -1:
 *         sqlite3_result_int64(ctx, <sqlite3_int64>pCur.idx)
 *         return SQLITE_OK             # <<<<<<<<<<<<<<
 * 
 *     row_data = <tuple>pCur.row_data
 */
    __pyx_r = SQLITE_OK;
    goto __pyx_L0;

    /* "sweepea.pyx":348
 *         tuple row_data
 * 
 *     if iCol == -1:             # <<<<<<<<<<<<<<
 *         sqlite3_result_int64(ctx, <sqlite3_int64>pCur.idx)
 *         return SQLITE_OK
 */
  }

  /* "sweepea.pyx":352
 *         return SQLITE_OK
 * 
 *     row_data = <tuple>pCur.row_data             # <<<<<<<<<<<<<<
 *     value = row_data[iCol]
 *     if value is None:
 */
  __pyx_t_2 = ((PyObject *)__pyx_v_pCur->row_data);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_row_data = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "sweepea.pyx":353
 * 
 *     row_data = <tuple>pCur.row_data
 *     value = row_data[iCol]             # <<<<<<<<<<<<<<
 *     if value is None:
 *         sqlite3_result_null(ctx)
 */
  if (unlikely(__pyx_v_row_data == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 353, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_GetItemInt_Tuple(__pyx_v_row_data, __pyx_v_iCol, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_value = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "sweepea.pyx":354
 *     row_data = <tuple>pCur.row_data
 *     value = row_data[iCol]
 *     if value is None:             # <<<<<<<<<<<<<<
 *         sqlite3_result_null(ctx)
 *     elif isinstance(value, (int, long)):
 */
  __pyx_t_1 = (__pyx_v_value == Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "sweepea.pyx":355
 *     value = row_data[iCol]
 *     if value is None:
 *         sqlite3_result_null(ctx)             # <<<<<<<<<<<<<<
 *     elif isinstance(value, (int, long)):
 *         sqlite3_result_int64(ctx, <sqlite3_int64>value)
 */
    sqlite3_result_null(__pyx_v_ctx);

    /* "sweepea.pyx":354
 *     row_data = <tuple>pCur.row_data
 *     value = row_data[iCol]
 *     if value is None:             # <<<<<<<<<<<<<<
 *         sqlite3_result_null(ctx)
 *     elif isinstance(value, (int, long)):
 */
    goto __pyx_L4;
  }

  /* "sweepea.pyx":356
 *     if value is None:
 *         sqlite3_result_null(ctx)
 *     elif isinstance(value, (int, long)):             # <<<<<<<<<<<<<<
 *         sqlite3_result_int64(ctx, <sqlite3_int64>value)
 *     elif isinstance(value, float):
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_value); 
  __pyx_t_4 = (__pyx_t_1 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_4 = PyLong_Check(__pyx_v_value); 
  __pyx_t_1 = (__pyx_t_4 != 0);
  __pyx_t_3 = __pyx_t_1;
  __pyx_L5_bool_binop_done:;
  __pyx_t_1 = (__pyx_t_3 != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":357
 *         sqlite3_result_null(ctx)
 *     elif isinstance(value, (int, long)):
 *         sqlite3_result_int64(ctx, <sqlite3_int64>value)             # <<<<<<<<<<<<<<
 *     elif isinstance(value, float):
 *         sqlite3_result_double(ctx, <double>value)
 */
    __pyx_t_5 = __Pyx_PyInt_As_sqlite3_int64(__pyx_v_value); if (unlikely((__pyx_t_5 == (sqlite3_int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 357, __pyx_L1_error)
    sqlite3_result_int64(__pyx_v_ctx, ((sqlite3_int64)__pyx_t_5));

    /* "sweepea.pyx":356
 *     if value is None:
 *         sqlite3_result_null(ctx)
 *     elif isinstance(value, (int, long)):             # <<<<<<<<<<<<<<
 *         sqlite3_result_int64(ctx, <sqlite3_int64>value)
 *     elif isinstance(value, float):
 */
    goto __pyx_L4;
  }

  /* "sweepea.pyx":358
 *     elif isinstance(value, (int, long)):
 *         sqlite3_result_int64(ctx, <sqlite3_int64>value)
 *     elif isinstance(value, float):             # <<<<<<<<<<<<<<
 *         sqlite3_result_double(ctx, <double>value)
 *     elif isinstance(value, basestring):
 */
  __pyx_t_1 = PyFloat_Check(__pyx_v_value); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "sweepea.pyx":359
 *         sqlite3_result_int64(ctx, <sqlite3_int64>value)
 *     elif isinstance(value, float):
 *         sqlite3_result_double(ctx, <double>value)             # <<<<<<<<<<<<<<
 *     elif isinstance(value, basestring):
 *         sqlite3_result_text(
 */
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 359, __pyx_L1_error)
    sqlite3_result_double(__pyx_v_ctx, ((double)__pyx_t_6));

    /* "sweepea.pyx":358
 *     elif isinstance(value, (int, long)):
 *         sqlite3_result_int64(ctx, <sqlite3_int64>value)
 *     elif isinstance(value, float):             # <<<<<<<<<<<<<<
 *         sqlite3_result_double(ctx, <double>value)
 *     elif isinstance(value, basestring):
 */
    goto __pyx_L4;
  }

  /* "sweepea.pyx":360
 *     elif isinstance(value, float):
 *         sqlite3_result_double(ctx, <double>value)
 *     elif isinstance(value, basestring):             # <<<<<<<<<<<<<<
 *         sqlite3_result_text(
 *             ctx,
 */
  __pyx_t_3 = __Pyx_PyBaseString_Check(__pyx_v_value); 
  __pyx_t_1 = (__pyx_t_3 != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":363
 *         sqlite3_result_text(
 *             ctx,
 *             <const char *>value,             # <<<<<<<<<<<<<<
 *             -1,
 *             <sqlite3_destructor_type>-1)
 */
    __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)

    /* "sweepea.pyx":361
 *         sqlite3_result_double(ctx, <double>value)
 *     elif isinstance(value, basestring):
 *         sqlite3_result_text(             # <<<<<<<<<<<<<<
 *             ctx,
 *             <const char *>value,
 */
    sqlite3_result_text(__pyx_v_ctx, ((char const *)__pyx_t_7), -1, ((sqlite3_destructor_type)-1L));

    /* "sweepea.pyx":360
 *     elif isinstance(value, float):
 *         sqlite3_result_double(ctx, <double>value)
 *     elif isinstance(value, basestring):             # <<<<<<<<<<<<<<
 *         sqlite3_result_text(
 *             ctx,
 */
    goto __pyx_L4;
  }

  /* "sweepea.pyx":366
 *             -1,
 *             <sqlite3_destructor_type>-1)
 *     elif isinstance(value, bool):             # <<<<<<<<<<<<<<
 *         sqlite3_result_int(ctx, int(value))
 *     else:
 */
  __pyx_t_2 = ((PyObject*)&PyBool_Type);
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_value, __pyx_t_2); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "sweepea.pyx":367
 *             <sqlite3_destructor_type>-1)
 *     elif isinstance(value, bool):
 *         sqlite3_result_int(ctx, int(value))             # <<<<<<<<<<<<<<
 *     else:
 *         sqlite3_result_error(ctx, 'Unsupported type %s' % type(value), -1)
 */
    __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 367, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    sqlite3_result_int(__pyx_v_ctx, __pyx_t_8);

    /* "sweepea.pyx":366
 *             -1,
 *             <sqlite3_destructor_type>-1)
 *     elif isinstance(value, bool):             # <<<<<<<<<<<<<<
 *         sqlite3_result_int(ctx, int(value))
 *     else:
 */
    goto __pyx_L4;
  }

  /* "sweepea.pyx":369
 *         sqlite3_result_int(ctx, int(value))
 *     else:
 *         sqlite3_result_error(ctx, 'Unsupported type %s' % type(value), -1)             # <<<<<<<<<<<<<<
 *         return SQLITE_ERROR
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Unsupported_type_s, ((PyObject *)Py_TYPE(__pyx_v_value))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 369, __pyx_L1_error)
    sqlite3_result_error(__pyx_v_ctx, __pyx_t_9, -1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":370
 *     else:
 *         sqlite3_result_error(ctx, 'Unsupported type %s' % type(value), -1)
 *         return SQLITE_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return SQLITE_OK
 */
    __pyx_r = SQLITE_ERROR;
    goto __pyx_L0;
  }
  __pyx_L4:;

  /* "sweepea.pyx":372
 *         return SQLITE_ERROR
 * 
 *     return SQLITE_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = SQLITE_OK;
  goto __pyx_L0;

  /* "sweepea.pyx":341
 * 
 * # Return the requested column from the current row.
 * cdef int pwColumn(sqlite3_vtab_cursor *pBase, sqlite3_context *ctx,             # <<<<<<<<<<<<<<
 *                   int iCol) with gil:
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("sweepea.pwColumn", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_row_data);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "sweepea.pyx":375
 * 
 * 
 * cdef int pwRowid(sqlite3_vtab_cursor *pBase, sqlite3_int64 *pRowid):             # <<<<<<<<<<<<<<
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 */

static int __pyx_f_7sweepea_pwRowid(sqlite3_vtab_cursor *__pyx_v_pBase, sqlite3_int64 *__pyx_v_pRowid) {
  __pyx_t_7sweepea_peewee_cursor *__pyx_v_pCur;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pwRowid", 0);

  /* "sweepea.pyx":377
 * cdef int pwRowid(sqlite3_vtab_cursor *pBase, sqlite3_int64 *pRowid):
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase             # <<<<<<<<<<<<<<
 *     pRowid[0] = <sqlite3_int64>pCur.idx
 *     return SQLITE_OK
 */
  __pyx_v_pCur = ((__pyx_t_7sweepea_peewee_cursor *)__pyx_v_pBase);

  /* "sweepea.pyx":378
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 *     pRowid[0] = <sqlite3_int64>pCur.idx             # <<<<<<<<<<<<<<
 *     return SQLITE_OK
 * 
 */
  (__pyx_v_pRowid[0]) = ((sqlite3_int64)__pyx_v_pCur->idx);

  /* "sweepea.pyx":379
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 *     pRowid[0] = <sqlite3_int64>pCur.idx
 *     return SQLITE_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = SQLITE_OK;
  goto __pyx_L0;

  /* "sweepea.pyx":375
 * 
 * 
 * cdef int pwRowid(sqlite3_vtab_cursor *pBase, sqlite3_int64 *pRowid):             # <<<<<<<<<<<<<<
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 */

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

/* "sweepea.pyx":383
 * 
 * # Return a boolean indicating whether the cursor has been consumed.
 * cdef int pwEof(sqlite3_vtab_cursor *pBase):             # <<<<<<<<<<<<<<
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 */

static int __pyx_f_7sweepea_pwEof(sqlite3_vtab_cursor *__pyx_v_pBase) {
  __pyx_t_7sweepea_peewee_cursor *__pyx_v_pCur;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("pwEof", 0);

  /* "sweepea.pyx":385
 * cdef int pwEof(sqlite3_vtab_cursor *pBase):
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase             # <<<<<<<<<<<<<<
 *     if pCur.stopped:
 *         return 1
 */
  __pyx_v_pCur = ((__pyx_t_7sweepea_peewee_cursor *)__pyx_v_pBase);

  /* "sweepea.pyx":386
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 *     if pCur.stopped:             # <<<<<<<<<<<<<<
 *         return 1
 *     return 0
 */
  __pyx_t_1 = (__pyx_v_pCur->stopped != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":387
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 *     if pCur.stopped:
 *         return 1             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
    __pyx_r = 1;
    goto __pyx_L0;

    /* "sweepea.pyx":386
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 *     if pCur.stopped:             # <<<<<<<<<<<<<<
 *         return 1
 *     return 0
 */
  }

  /* "sweepea.pyx":388
 *     if pCur.stopped:
 *         return 1
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":383
 * 
 * # Return a boolean indicating whether the cursor has been consumed.
 * cdef int pwEof(sqlite3_vtab_cursor *pBase):             # <<<<<<<<<<<<<<
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 */

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

/* "sweepea.pyx":394
 * # get access to the parameters that the function was called with, and call the
 * # TableFunction's `initialize()` function.
 * cdef int pwFilter(sqlite3_vtab_cursor *pBase, int idxNum,             # <<<<<<<<<<<<<<
 *                   const char *idxStr, int argc, sqlite3_value **argv) with gil:
 *     cdef:
 */

static int __pyx_f_7sweepea_pwFilter(sqlite3_vtab_cursor *__pyx_v_pBase, CYTHON_UNUSED int __pyx_v_idxNum, char const *__pyx_v_idxStr, int __pyx_v_argc, sqlite3_value **__pyx_v_argv) {
  __pyx_t_7sweepea_peewee_cursor *__pyx_v_pCur;
  PyObject *__pyx_v_table_func = 0;
  PyObject *__pyx_v_query = 0;
  int __pyx_v_idx;
  int __pyx_v_value_type;
  PyObject *__pyx_v_row_data = 0;
  PyObject *__pyx_v_params = NULL;
  PyObject *__pyx_v_param = NULL;
  sqlite3_value *__pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  void const *__pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("pwFilter", 0);

  /* "sweepea.pyx":397
 *                   const char *idxStr, int argc, sqlite3_value **argv) with gil:
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase             # <<<<<<<<<<<<<<
 *         object table_func = <object>pCur.table_func
 *         dict query = {}
 */
  __pyx_v_pCur = ((__pyx_t_7sweepea_peewee_cursor *)__pyx_v_pBase);

  /* "sweepea.pyx":398
 *     cdef:
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 *         object table_func = <object>pCur.table_func             # <<<<<<<<<<<<<<
 *         dict query = {}
 *         int idx
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_pCur->table_func);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_table_func = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":399
 *         peewee_cursor *pCur = <peewee_cursor *>pBase
 *         object table_func = <object>pCur.table_func
 *         dict query = {}             # <<<<<<<<<<<<<<
 *         int idx
 *         int value_type
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_query = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":405
 *         void *row_data_raw
 * 
 *     if not idxStr or argc == 0 and len(table_func.params):             # <<<<<<<<<<<<<<
 *         return SQLITE_ERROR
 *     elif idxStr:
 */
  __pyx_t_3 = ((!(__pyx_v_idxStr != 0)) != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = ((__pyx_v_argc == 0) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_table_func, __pyx_n_s_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 405, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_2) {

    /* "sweepea.pyx":406
 * 
 *     if not idxStr or argc == 0 and len(table_func.params):
 *         return SQLITE_ERROR             # <<<<<<<<<<<<<<
 *     elif idxStr:
 *         params = str(idxStr).split(',')
 */
    __pyx_r = SQLITE_ERROR;
    goto __pyx_L0;

    /* "sweepea.pyx":405
 *         void *row_data_raw
 * 
 *     if not idxStr or argc == 0 and len(table_func.params):             # <<<<<<<<<<<<<<
 *         return SQLITE_ERROR
 *     elif idxStr:
 */
  }

  /* "sweepea.pyx":407
 *     if not idxStr or argc == 0 and len(table_func.params):
 *         return SQLITE_ERROR
 *     elif idxStr:             # <<<<<<<<<<<<<<
 *         params = str(idxStr).split(',')
 *     else:
 */
  __pyx_t_2 = (__pyx_v_idxStr != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":408
 *         return SQLITE_ERROR
 *     elif idxStr:
 *         params = str(idxStr).split(',')             # <<<<<<<<<<<<<<
 *     else:
 *         params = []
 */
    __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_idxStr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __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, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_split); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_params = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "sweepea.pyx":407
 *     if not idxStr or argc == 0 and len(table_func.params):
 *         return SQLITE_ERROR
 *     elif idxStr:             # <<<<<<<<<<<<<<
 *         params = str(idxStr).split(',')
 *     else:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":410
 *         params = str(idxStr).split(',')
 *     else:
 *         params = []             # <<<<<<<<<<<<<<
 * 
 *     for idx, param in enumerate(params):
 */
  /*else*/ {
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_params = __pyx_t_1;
    __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "sweepea.pyx":412
 *         params = []
 * 
 *     for idx, param in enumerate(params):             # <<<<<<<<<<<<<<
 *         value = argv[idx]
 *         if not value:
 */
  __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(__pyx_v_params)) || PyTuple_CheckExact(__pyx_v_params)) {
    __pyx_t_1 = __pyx_v_params; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 412, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 412, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 412, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_7(__pyx_t_1);
      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, 412, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_v_idx = __pyx_t_6;
    __pyx_t_6 = (__pyx_t_6 + 1);

    /* "sweepea.pyx":413
 * 
 *     for idx, param in enumerate(params):
 *         value = argv[idx]             # <<<<<<<<<<<<<<
 *         if not value:
 *             query[param] = None
 */
    __pyx_v_value = (__pyx_v_argv[__pyx_v_idx]);

    /* "sweepea.pyx":414
 *     for idx, param in enumerate(params):
 *         value = argv[idx]
 *         if not value:             # <<<<<<<<<<<<<<
 *             query[param] = None
 *             continue
 */
    __pyx_t_2 = ((!(__pyx_v_value != 0)) != 0);
    if (__pyx_t_2) {

      /* "sweepea.pyx":415
 *         value = argv[idx]
 *         if not value:
 *             query[param] = None             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
      if (unlikely(PyDict_SetItem(__pyx_v_query, __pyx_v_param, Py_None) < 0)) __PYX_ERR(0, 415, __pyx_L1_error)

      /* "sweepea.pyx":416
 *         if not value:
 *             query[param] = None
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         value_type = sqlite3_value_type(value)
 */
      goto __pyx_L7_continue;

      /* "sweepea.pyx":414
 *     for idx, param in enumerate(params):
 *         value = argv[idx]
 *         if not value:             # <<<<<<<<<<<<<<
 *             query[param] = None
 *             continue
 */
    }

    /* "sweepea.pyx":418
 *             continue
 * 
 *         value_type = sqlite3_value_type(value)             # <<<<<<<<<<<<<<
 *         if value_type == SQLITE_INTEGER:
 *             query[param] = sqlite3_value_int(value)
 */
    __pyx_v_value_type = sqlite3_value_type(__pyx_v_value);

    /* "sweepea.pyx":419
 * 
 *         value_type = sqlite3_value_type(value)
 *         if value_type == SQLITE_INTEGER:             # <<<<<<<<<<<<<<
 *             query[param] = sqlite3_value_int(value)
 *         elif value_type == SQLITE_FLOAT:
 */
    __pyx_t_2 = ((__pyx_v_value_type == SQLITE_INTEGER) != 0);
    if (__pyx_t_2) {

      /* "sweepea.pyx":420
 *         value_type = sqlite3_value_type(value)
 *         if value_type == SQLITE_INTEGER:
 *             query[param] = sqlite3_value_int(value)             # <<<<<<<<<<<<<<
 *         elif value_type == SQLITE_FLOAT:
 *             query[param] = sqlite3_value_double(value)
 */
      __pyx_t_5 = __Pyx_PyInt_From_int(sqlite3_value_int(__pyx_v_value)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_v_query, __pyx_v_param, __pyx_t_5) < 0)) __PYX_ERR(0, 420, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "sweepea.pyx":419
 * 
 *         value_type = sqlite3_value_type(value)
 *         if value_type == SQLITE_INTEGER:             # <<<<<<<<<<<<<<
 *             query[param] = sqlite3_value_int(value)
 *         elif value_type == SQLITE_FLOAT:
 */
      goto __pyx_L10;
    }

    /* "sweepea.pyx":421
 *         if value_type == SQLITE_INTEGER:
 *             query[param] = sqlite3_value_int(value)
 *         elif value_type == SQLITE_FLOAT:             # <<<<<<<<<<<<<<
 *             query[param] = sqlite3_value_double(value)
 *         elif value_type == SQLITE_TEXT:
 */
    __pyx_t_2 = ((__pyx_v_value_type == SQLITE_FLOAT) != 0);
    if (__pyx_t_2) {

      /* "sweepea.pyx":422
 *             query[param] = sqlite3_value_int(value)
 *         elif value_type == SQLITE_FLOAT:
 *             query[param] = sqlite3_value_double(value)             # <<<<<<<<<<<<<<
 *         elif value_type == SQLITE_TEXT:
 *             query[param] = str(sqlite3_value_text(value))
 */
      __pyx_t_5 = PyFloat_FromDouble(sqlite3_value_double(__pyx_v_value)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 422, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_v_query, __pyx_v_param, __pyx_t_5) < 0)) __PYX_ERR(0, 422, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "sweepea.pyx":421
 *         if value_type == SQLITE_INTEGER:
 *             query[param] = sqlite3_value_int(value)
 *         elif value_type == SQLITE_FLOAT:             # <<<<<<<<<<<<<<
 *             query[param] = sqlite3_value_double(value)
 *         elif value_type == SQLITE_TEXT:
 */
      goto __pyx_L10;
    }

    /* "sweepea.pyx":423
 *         elif value_type == SQLITE_FLOAT:
 *             query[param] = sqlite3_value_double(value)
 *         elif value_type == SQLITE_TEXT:             # <<<<<<<<<<<<<<
 *             query[param] = str(sqlite3_value_text(value))
 *         elif value_type == SQLITE_BLOB:
 */
    __pyx_t_2 = ((__pyx_v_value_type == SQLITE_TEXT) != 0);
    if (__pyx_t_2) {

      /* "sweepea.pyx":424
 *             query[param] = sqlite3_value_double(value)
 *         elif value_type == SQLITE_TEXT:
 *             query[param] = str(sqlite3_value_text(value))             # <<<<<<<<<<<<<<
 *         elif value_type == SQLITE_BLOB:
 *             query[param] = <bytes>sqlite3_value_blob(value)
 */
      __pyx_t_5 = __Pyx_PyBytes_FromCString(sqlite3_value_text(__pyx_v_value)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_8, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(PyDict_SetItem(__pyx_v_query, __pyx_v_param, __pyx_t_5) < 0)) __PYX_ERR(0, 424, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "sweepea.pyx":423
 *         elif value_type == SQLITE_FLOAT:
 *             query[param] = sqlite3_value_double(value)
 *         elif value_type == SQLITE_TEXT:             # <<<<<<<<<<<<<<
 *             query[param] = str(sqlite3_value_text(value))
 *         elif value_type == SQLITE_BLOB:
 */
      goto __pyx_L10;
    }

    /* "sweepea.pyx":425
 *         elif value_type == SQLITE_TEXT:
 *             query[param] = str(sqlite3_value_text(value))
 *         elif value_type == SQLITE_BLOB:             # <<<<<<<<<<<<<<
 *             query[param] = <bytes>sqlite3_value_blob(value)
 *         elif value_type == SQLITE_NULL:
 */
    __pyx_t_2 = ((__pyx_v_value_type == SQLITE_BLOB) != 0);
    if (__pyx_t_2) {

      /* "sweepea.pyx":426
 *             query[param] = str(sqlite3_value_text(value))
 *         elif value_type == SQLITE_BLOB:
 *             query[param] = <bytes>sqlite3_value_blob(value)             # <<<<<<<<<<<<<<
 *         elif value_type == SQLITE_NULL:
 *             query[param] = None
 */
      __pyx_t_9 = sqlite3_value_blob(__pyx_v_value);
      __pyx_t_5 = ((PyObject *)__pyx_t_9);
      __Pyx_INCREF(__pyx_t_5);
      if (unlikely(PyDict_SetItem(__pyx_v_query, __pyx_v_param, __pyx_t_5) < 0)) __PYX_ERR(0, 426, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "sweepea.pyx":425
 *         elif value_type == SQLITE_TEXT:
 *             query[param] = str(sqlite3_value_text(value))
 *         elif value_type == SQLITE_BLOB:             # <<<<<<<<<<<<<<
 *             query[param] = <bytes>sqlite3_value_blob(value)
 *         elif value_type == SQLITE_NULL:
 */
      goto __pyx_L10;
    }

    /* "sweepea.pyx":427
 *         elif value_type == SQLITE_BLOB:
 *             query[param] = <bytes>sqlite3_value_blob(value)
 *         elif value_type == SQLITE_NULL:             # <<<<<<<<<<<<<<
 *             query[param] = None
 *         else:
 */
    __pyx_t_2 = ((__pyx_v_value_type == SQLITE_NULL) != 0);
    if (__pyx_t_2) {

      /* "sweepea.pyx":428
 *             query[param] = <bytes>sqlite3_value_blob(value)
 *         elif value_type == SQLITE_NULL:
 *             query[param] = None             # <<<<<<<<<<<<<<
 *         else:
 *             query[param] = None
 */
      if (unlikely(PyDict_SetItem(__pyx_v_query, __pyx_v_param, Py_None) < 0)) __PYX_ERR(0, 428, __pyx_L1_error)

      /* "sweepea.pyx":427
 *         elif value_type == SQLITE_BLOB:
 *             query[param] = <bytes>sqlite3_value_blob(value)
 *         elif value_type == SQLITE_NULL:             # <<<<<<<<<<<<<<
 *             query[param] = None
 *         else:
 */
      goto __pyx_L10;
    }

    /* "sweepea.pyx":430
 *             query[param] = None
 *         else:
 *             query[param] = None             # <<<<<<<<<<<<<<
 * 
 *     table_func.initialize(**query)
 */
    /*else*/ {
      if (unlikely(PyDict_SetItem(__pyx_v_query, __pyx_v_param, Py_None) < 0)) __PYX_ERR(0, 430, __pyx_L1_error)
    }
    __pyx_L10:;

    /* "sweepea.pyx":412
 *         params = []
 * 
 *     for idx, param in enumerate(params):             # <<<<<<<<<<<<<<
 *         value = argv[idx]
 *         if not value:
 */
    __pyx_L7_continue:;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":432
 *             query[param] = None
 * 
 *     table_func.initialize(**query)             # <<<<<<<<<<<<<<
 *     pCur.stopped = False
 *     try:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_table_func, __pyx_n_s_initialize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_v_query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 432, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":433
 * 
 *     table_func.initialize(**query)
 *     pCur.stopped = False             # <<<<<<<<<<<<<<
 *     try:
 *         row_data = table_func.iterate(0)
 */
  __pyx_v_pCur->stopped = 0;

  /* "sweepea.pyx":434
 *     table_func.initialize(**query)
 *     pCur.stopped = False
 *     try:             # <<<<<<<<<<<<<<
 *         row_data = table_func.iterate(0)
 *     except StopIteration:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_12);
    /*try:*/ {

      /* "sweepea.pyx":435
 *     pCur.stopped = False
 *     try:
 *         row_data = table_func.iterate(0)             # <<<<<<<<<<<<<<
 *     except StopIteration:
 *         pCur.stopped = True
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_table_func, __pyx_n_s_iterate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 435, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 435, __pyx_L11_error)
      __pyx_v_row_data = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "sweepea.pyx":434
 *     table_func.initialize(**query)
 *     pCur.stopped = False
 *     try:             # <<<<<<<<<<<<<<
 *         row_data = table_func.iterate(0)
 *     except StopIteration:
 */
    }

    /* "sweepea.pyx":439
 *         pCur.stopped = True
 *     else:
 *         Py_INCREF(row_data)             # <<<<<<<<<<<<<<
 *         pCur.row_data = <void *>row_data
 *         pCur.idx += 1
 */
    /*else:*/ {
      Py_INCREF(__pyx_v_row_data);

      /* "sweepea.pyx":440
 *     else:
 *         Py_INCREF(row_data)
 *         pCur.row_data = <void *>row_data             # <<<<<<<<<<<<<<
 *         pCur.idx += 1
 *     return SQLITE_OK
 */
      __pyx_v_pCur->row_data = ((void *)__pyx_v_row_data);

      /* "sweepea.pyx":441
 *         Py_INCREF(row_data)
 *         pCur.row_data = <void *>row_data
 *         pCur.idx += 1             # <<<<<<<<<<<<<<
 *     return SQLITE_OK
 * 
 */
      __pyx_v_pCur->idx = (__pyx_v_pCur->idx + 1);
    }
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    goto __pyx_L18_try_end;
    __pyx_L11_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":436
 *     try:
 *         row_data = table_func.iterate(0)
 *     except StopIteration:             # <<<<<<<<<<<<<<
 *         pCur.stopped = True
 *     else:
 */
    __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
    if (__pyx_t_6) {
      __Pyx_AddTraceback("sweepea.pwFilter", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_8) < 0) __PYX_ERR(0, 436, __pyx_L13_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_8);

      /* "sweepea.pyx":437
 *         row_data = table_func.iterate(0)
 *     except StopIteration:
 *         pCur.stopped = True             # <<<<<<<<<<<<<<
 *     else:
 *         Py_INCREF(row_data)
 */
      __pyx_v_pCur->stopped = 1;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L12_exception_handled;
    }
    goto __pyx_L13_except_error;
    __pyx_L13_except_error:;

    /* "sweepea.pyx":434
 *     table_func.initialize(**query)
 *     pCur.stopped = False
 *     try:             # <<<<<<<<<<<<<<
 *         row_data = table_func.iterate(0)
 *     except StopIteration:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_12);
    __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
    goto __pyx_L1_error;
    __pyx_L12_exception_handled:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_XGIVEREF(__pyx_t_12);
    __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
    __pyx_L18_try_end:;
  }

  /* "sweepea.pyx":442
 *         pCur.row_data = <void *>row_data
 *         pCur.idx += 1
 *     return SQLITE_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = SQLITE_OK;
  goto __pyx_L0;

  /* "sweepea.pyx":394
 * # get access to the parameters that the function was called with, and call the
 * # TableFunction's `initialize()` function.
 * cdef int pwFilter(sqlite3_vtab_cursor *pBase, int idxNum,             # <<<<<<<<<<<<<<
 *                   const char *idxStr, int argc, sqlite3_value **argv) with gil:
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("sweepea.pwFilter", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_func);
  __Pyx_XDECREF(__pyx_v_query);
  __Pyx_XDECREF(__pyx_v_row_data);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XDECREF(__pyx_v_param);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "sweepea.pyx":447
 * # SQLite will (in some cases, repeatedly) call the xBestIndex method to try and
 * # find the best query plan.
 * cdef int pwBestIndex(sqlite3_vtab *pBase, sqlite3_index_info *pIdxInfo) \             # <<<<<<<<<<<<<<
 *         with gil:
 *     cdef:
 */

static int __pyx_f_7sweepea_pwBestIndex(sqlite3_vtab *__pyx_v_pBase, sqlite3_index_info *__pyx_v_pIdxInfo) {
  int __pyx_v_i;
  CYTHON_UNUSED int __pyx_v_idxNum;
  int __pyx_v_nArg;
  __pyx_t_7sweepea_peewee_vtab *__pyx_v_pVtab;
  PyObject *__pyx_v_table_func_cls = 0;
  struct __pyx_t_7sweepea_sqlite3_index_constraint *__pyx_v_pConstraint;
  PyObject *__pyx_v_columns = 0;
  char *__pyx_v_idxStr;
  int __pyx_v_nParams;
  PyObject *__pyx_v_joinedCols = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  char *__pyx_t_10;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("pwBestIndex", 0);

  /* "sweepea.pyx":451
 *     cdef:
 *         int i
 *         int idxNum = 0, nArg = 0             # <<<<<<<<<<<<<<
 *         peewee_vtab *pVtab = <peewee_vtab *>pBase
 *         object table_func_cls = <object>pVtab.table_func_cls
 */
  __pyx_v_idxNum = 0;
  __pyx_v_nArg = 0;

  /* "sweepea.pyx":452
 *         int i
 *         int idxNum = 0, nArg = 0
 *         peewee_vtab *pVtab = <peewee_vtab *>pBase             # <<<<<<<<<<<<<<
 *         object table_func_cls = <object>pVtab.table_func_cls
 *         sqlite3_index_constraint *pConstraint
 */
  __pyx_v_pVtab = ((__pyx_t_7sweepea_peewee_vtab *)__pyx_v_pBase);

  /* "sweepea.pyx":453
 *         int idxNum = 0, nArg = 0
 *         peewee_vtab *pVtab = <peewee_vtab *>pBase
 *         object table_func_cls = <object>pVtab.table_func_cls             # <<<<<<<<<<<<<<
 *         sqlite3_index_constraint *pConstraint
 *         list columns = []
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_pVtab->table_func_cls);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_table_func_cls = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":455
 *         object table_func_cls = <object>pVtab.table_func_cls
 *         sqlite3_index_constraint *pConstraint
 *         list columns = []             # <<<<<<<<<<<<<<
 *         char *idxStr
 *         int nParams = len(table_func_cls.params)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_columns = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":457
 *         list columns = []
 *         char *idxStr
 *         int nParams = len(table_func_cls.params)             # <<<<<<<<<<<<<<
 * 
 *     pConstraint = <sqlite3_index_constraint*>0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_table_func_cls, __pyx_n_s_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_nParams = __pyx_t_2;

  /* "sweepea.pyx":459
 *         int nParams = len(table_func_cls.params)
 * 
 *     pConstraint = <sqlite3_index_constraint*>0             # <<<<<<<<<<<<<<
 *     for i in range(pIdxInfo.nConstraint):
 *         pConstraint = &pIdxInfo.aConstraint[i]
 */
  __pyx_v_pConstraint = ((struct __pyx_t_7sweepea_sqlite3_index_constraint *)0);

  /* "sweepea.pyx":460
 * 
 *     pConstraint = <sqlite3_index_constraint*>0
 *     for i in range(pIdxInfo.nConstraint):             # <<<<<<<<<<<<<<
 *         pConstraint = &pIdxInfo.aConstraint[i]
 *         if not pConstraint.usable:
 */
  __pyx_t_3 = __pyx_v_pIdxInfo->nConstraint;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "sweepea.pyx":461
 *     pConstraint = <sqlite3_index_constraint*>0
 *     for i in range(pIdxInfo.nConstraint):
 *         pConstraint = &pIdxInfo.aConstraint[i]             # <<<<<<<<<<<<<<
 *         if not pConstraint.usable:
 *             continue
 */
    __pyx_v_pConstraint = (&(__pyx_v_pIdxInfo->aConstraint[__pyx_v_i]));

    /* "sweepea.pyx":462
 *     for i in range(pIdxInfo.nConstraint):
 *         pConstraint = &pIdxInfo.aConstraint[i]
 *         if not pConstraint.usable:             # <<<<<<<<<<<<<<
 *             continue
 *         if pConstraint.op != SQLITE_INDEX_CONSTRAINT_EQ:
 */
    __pyx_t_5 = ((!(__pyx_v_pConstraint->usable != 0)) != 0);
    if (__pyx_t_5) {

      /* "sweepea.pyx":463
 *         pConstraint = &pIdxInfo.aConstraint[i]
 *         if not pConstraint.usable:
 *             continue             # <<<<<<<<<<<<<<
 *         if pConstraint.op != SQLITE_INDEX_CONSTRAINT_EQ:
 *             continue
 */
      goto __pyx_L3_continue;

      /* "sweepea.pyx":462
 *     for i in range(pIdxInfo.nConstraint):
 *         pConstraint = &pIdxInfo.aConstraint[i]
 *         if not pConstraint.usable:             # <<<<<<<<<<<<<<
 *             continue
 *         if pConstraint.op != SQLITE_INDEX_CONSTRAINT_EQ:
 */
    }

    /* "sweepea.pyx":464
 *         if not pConstraint.usable:
 *             continue
 *         if pConstraint.op != SQLITE_INDEX_CONSTRAINT_EQ:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    __pyx_t_5 = ((__pyx_v_pConstraint->op != SQLITE_INDEX_CONSTRAINT_EQ) != 0);
    if (__pyx_t_5) {

      /* "sweepea.pyx":465
 *             continue
 *         if pConstraint.op != SQLITE_INDEX_CONSTRAINT_EQ:
 *             continue             # <<<<<<<<<<<<<<
 * 
 *         columns.append(table_func_cls.params[pConstraint.iColumn -
 */
      goto __pyx_L3_continue;

      /* "sweepea.pyx":464
 *         if not pConstraint.usable:
 *             continue
 *         if pConstraint.op != SQLITE_INDEX_CONSTRAINT_EQ:             # <<<<<<<<<<<<<<
 *             continue
 * 
 */
    }

    /* "sweepea.pyx":467
 *             continue
 * 
 *         columns.append(table_func_cls.params[pConstraint.iColumn -             # <<<<<<<<<<<<<<
 *                                              table_func_cls._ncols])
 *         nArg += 1
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_table_func_cls, __pyx_n_s_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_pConstraint->iColumn); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "sweepea.pyx":468
 * 
 *         columns.append(table_func_cls.params[pConstraint.iColumn -
 *                                              table_func_cls._ncols])             # <<<<<<<<<<<<<<
 *         nArg += 1
 *         pIdxInfo.aConstraintUsage[i].argvIndex = nArg
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_table_func_cls, __pyx_n_s_ncols); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);

    /* "sweepea.pyx":467
 *             continue
 * 
 *         columns.append(table_func_cls.params[pConstraint.iColumn -             # <<<<<<<<<<<<<<
 *                                              table_func_cls._ncols])
 *         nArg += 1
 */
    __pyx_t_8 = PyNumber_Subtract(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyObject_GetItem(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_columns, __pyx_t_7); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "sweepea.pyx":469
 *         columns.append(table_func_cls.params[pConstraint.iColumn -
 *                                              table_func_cls._ncols])
 *         nArg += 1             # <<<<<<<<<<<<<<
 *         pIdxInfo.aConstraintUsage[i].argvIndex = nArg
 *         pIdxInfo.aConstraintUsage[i].omit = 1
 */
    __pyx_v_nArg = (__pyx_v_nArg + 1);

    /* "sweepea.pyx":470
 *                                              table_func_cls._ncols])
 *         nArg += 1
 *         pIdxInfo.aConstraintUsage[i].argvIndex = nArg             # <<<<<<<<<<<<<<
 *         pIdxInfo.aConstraintUsage[i].omit = 1
 * 
 */
    (__pyx_v_pIdxInfo->aConstraintUsage[__pyx_v_i]).argvIndex = __pyx_v_nArg;

    /* "sweepea.pyx":471
 *         nArg += 1
 *         pIdxInfo.aConstraintUsage[i].argvIndex = nArg
 *         pIdxInfo.aConstraintUsage[i].omit = 1             # <<<<<<<<<<<<<<
 * 
 *     if nArg > 0:
 */
    (__pyx_v_pIdxInfo->aConstraintUsage[__pyx_v_i]).omit = 1;
    __pyx_L3_continue:;
  }

  /* "sweepea.pyx":473
 *         pIdxInfo.aConstraintUsage[i].omit = 1
 * 
 *     if nArg > 0:             # <<<<<<<<<<<<<<
 *         if nArg == nParams:
 *             # All parameters are present, this is ideal.
 */
  __pyx_t_5 = ((__pyx_v_nArg > 0) != 0);
  if (__pyx_t_5) {

    /* "sweepea.pyx":474
 * 
 *     if nArg > 0:
 *         if nArg == nParams:             # <<<<<<<<<<<<<<
 *             # All parameters are present, this is ideal.
 *             pIdxInfo.estimatedCost = <double>1
 */
    __pyx_t_5 = ((__pyx_v_nArg == __pyx_v_nParams) != 0);
    if (__pyx_t_5) {

      /* "sweepea.pyx":476
 *         if nArg == nParams:
 *             # All parameters are present, this is ideal.
 *             pIdxInfo.estimatedCost = <double>1             # <<<<<<<<<<<<<<
 *             pIdxInfo.estimatedRows = 10
 *         else:
 */
      __pyx_v_pIdxInfo->estimatedCost = ((double)1);

      /* "sweepea.pyx":477
 *             # All parameters are present, this is ideal.
 *             pIdxInfo.estimatedCost = <double>1
 *             pIdxInfo.estimatedRows = 10             # <<<<<<<<<<<<<<
 *         else:
 *             # Penalize score based on number of missing params.
 */
      __pyx_v_pIdxInfo->estimatedRows = 10;

      /* "sweepea.pyx":474
 * 
 *     if nArg > 0:
 *         if nArg == nParams:             # <<<<<<<<<<<<<<
 *             # All parameters are present, this is ideal.
 *             pIdxInfo.estimatedCost = <double>1
 */
      goto __pyx_L8;
    }

    /* "sweepea.pyx":480
 *         else:
 *             # Penalize score based on number of missing params.
 *             pIdxInfo.estimatedCost = <double>10000000000000 * <double>(nParams - nArg)             # <<<<<<<<<<<<<<
 *             pIdxInfo.estimatedRows = 10 ** (nParams - nArg)
 * 
 */
    /*else*/ {
      __pyx_v_pIdxInfo->estimatedCost = (((double)10000000000000.0) * ((double)(__pyx_v_nParams - __pyx_v_nArg)));

      /* "sweepea.pyx":481
 *             # Penalize score based on number of missing params.
 *             pIdxInfo.estimatedCost = <double>10000000000000 * <double>(nParams - nArg)
 *             pIdxInfo.estimatedRows = 10 ** (nParams - nArg)             # <<<<<<<<<<<<<<
 * 
 *         # Store a reference to the columns in the index info structure.
 */
      __pyx_v_pIdxInfo->estimatedRows = __Pyx_pow_long(10, ((long)(__pyx_v_nParams - __pyx_v_nArg)));
    }
    __pyx_L8:;

    /* "sweepea.pyx":484
 * 
 *         # Store a reference to the columns in the index info structure.
 *         joinedCols = ','.join(columns)             # <<<<<<<<<<<<<<
 *         idxStr = <char *>sqlite3_malloc((len(joinedCols) + 1) * sizeof(char))
 *         memcpy(idxStr, <char *>joinedCols, len(joinedCols))
 */
    __pyx_t_7 = __Pyx_PyString_Join(__pyx_kp_s_, __pyx_v_columns); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_v_joinedCols = ((PyObject*)__pyx_t_7);
    __pyx_t_7 = 0;

    /* "sweepea.pyx":485
 *         # Store a reference to the columns in the index info structure.
 *         joinedCols = ','.join(columns)
 *         idxStr = <char *>sqlite3_malloc((len(joinedCols) + 1) * sizeof(char))             # <<<<<<<<<<<<<<
 *         memcpy(idxStr, <char *>joinedCols, len(joinedCols))
 *         idxStr[len(joinedCols)] = '\x00'
 */
    __pyx_t_2 = PyObject_Length(__pyx_v_joinedCols); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 485, __pyx_L1_error)
    __pyx_v_idxStr = ((char *)sqlite3_malloc(((__pyx_t_2 + 1) * (sizeof(char)))));

    /* "sweepea.pyx":486
 *         joinedCols = ','.join(columns)
 *         idxStr = <char *>sqlite3_malloc((len(joinedCols) + 1) * sizeof(char))
 *         memcpy(idxStr, <char *>joinedCols, len(joinedCols))             # <<<<<<<<<<<<<<
 *         idxStr[len(joinedCols)] = '\x00'
 *         pIdxInfo.idxStr = idxStr
 */
    __pyx_t_10 = __Pyx_PyObject_AsString(__pyx_v_joinedCols); if (unlikely((!__pyx_t_10) && PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L1_error)
    __pyx_t_2 = PyObject_Length(__pyx_v_joinedCols); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 486, __pyx_L1_error)
    memcpy(__pyx_v_idxStr, ((char *)__pyx_t_10), __pyx_t_2);

    /* "sweepea.pyx":487
 *         idxStr = <char *>sqlite3_malloc((len(joinedCols) + 1) * sizeof(char))
 *         memcpy(idxStr, <char *>joinedCols, len(joinedCols))
 *         idxStr[len(joinedCols)] = '\x00'             # <<<<<<<<<<<<<<
 *         pIdxInfo.idxStr = idxStr
 *         pIdxInfo.needToFreeIdxStr = 0
 */
    __pyx_t_2 = PyObject_Length(__pyx_v_joinedCols); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
    (__pyx_v_idxStr[__pyx_t_2]) = '\x00';

    /* "sweepea.pyx":488
 *         memcpy(idxStr, <char *>joinedCols, len(joinedCols))
 *         idxStr[len(joinedCols)] = '\x00'
 *         pIdxInfo.idxStr = idxStr             # <<<<<<<<<<<<<<
 *         pIdxInfo.needToFreeIdxStr = 0
 *     else:
 */
    __pyx_v_pIdxInfo->idxStr = __pyx_v_idxStr;

    /* "sweepea.pyx":489
 *         idxStr[len(joinedCols)] = '\x00'
 *         pIdxInfo.idxStr = idxStr
 *         pIdxInfo.needToFreeIdxStr = 0             # <<<<<<<<<<<<<<
 *     else:
 *         pIdxInfo.estimatedCost = DBL_MAX
 */
    __pyx_v_pIdxInfo->needToFreeIdxStr = 0;

    /* "sweepea.pyx":473
 *         pIdxInfo.aConstraintUsage[i].omit = 1
 * 
 *     if nArg > 0:             # <<<<<<<<<<<<<<
 *         if nArg == nParams:
 *             # All parameters are present, this is ideal.
 */
    goto __pyx_L7;
  }

  /* "sweepea.pyx":491
 *         pIdxInfo.needToFreeIdxStr = 0
 *     else:
 *         pIdxInfo.estimatedCost = DBL_MAX             # <<<<<<<<<<<<<<
 *         pIdxInfo.estimatedRows = 100000
 *     return SQLITE_OK
 */
  /*else*/ {
    __pyx_v_pIdxInfo->estimatedCost = DBL_MAX;

    /* "sweepea.pyx":492
 *     else:
 *         pIdxInfo.estimatedCost = DBL_MAX
 *         pIdxInfo.estimatedRows = 100000             # <<<<<<<<<<<<<<
 *     return SQLITE_OK
 * 
 */
    __pyx_v_pIdxInfo->estimatedRows = 0x186A0;
  }
  __pyx_L7:;

  /* "sweepea.pyx":493
 *         pIdxInfo.estimatedCost = DBL_MAX
 *         pIdxInfo.estimatedRows = 100000
 *     return SQLITE_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = SQLITE_OK;
  goto __pyx_L0;

  /* "sweepea.pyx":447
 * # SQLite will (in some cases, repeatedly) call the xBestIndex method to try and
 * # find the best query plan.
 * cdef int pwBestIndex(sqlite3_vtab *pBase, sqlite3_index_info *pIdxInfo) \             # <<<<<<<<<<<<<<
 *         with gil:
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_WriteUnraisable("sweepea.pwBestIndex", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_table_func_cls);
  __Pyx_XDECREF(__pyx_v_columns);
  __Pyx_XDECREF(__pyx_v_joinedCols);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "sweepea.pyx":501
 *         object table_function
 * 
 *     def __cinit__(self, table_function):             # <<<<<<<<<<<<<<
 *         self.table_function = table_function
 * 
 */

/* Python wrapper */
static int __pyx_pw_7sweepea_18_TableFunctionImpl_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7sweepea_18_TableFunctionImpl_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_table_function = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_table_function,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) {
        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_table_function)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 501, __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_table_function = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 501, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea._TableFunctionImpl.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_18_TableFunctionImpl___cinit__(((struct __pyx_obj_7sweepea__TableFunctionImpl *)__pyx_v_self), __pyx_v_table_function);

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

static int __pyx_pf_7sweepea_18_TableFunctionImpl___cinit__(struct __pyx_obj_7sweepea__TableFunctionImpl *__pyx_v_self, PyObject *__pyx_v_table_function) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "sweepea.pyx":502
 * 
 *     def __cinit__(self, table_function):
 *         self.table_function = table_function             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __Pyx_INCREF(__pyx_v_table_function);
  __Pyx_GIVEREF(__pyx_v_table_function);
  __Pyx_GOTREF(__pyx_v_self->table_function);
  __Pyx_DECREF(__pyx_v_self->table_function);
  __pyx_v_self->table_function = __pyx_v_table_function;

  /* "sweepea.pyx":501
 *         object table_function
 * 
 *     def __cinit__(self, table_function):             # <<<<<<<<<<<<<<
 *         self.table_function = table_function
 * 
 */

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

/* "sweepea.pyx":504
 *         self.table_function = table_function
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         Py_DECREF(self)
 * 
 */

/* Python wrapper */
static void __pyx_pw_7sweepea_18_TableFunctionImpl_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7sweepea_18_TableFunctionImpl_3__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7sweepea_18_TableFunctionImpl_2__dealloc__(((struct __pyx_obj_7sweepea__TableFunctionImpl *)__pyx_v_self));

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

static void __pyx_pf_7sweepea_18_TableFunctionImpl_2__dealloc__(struct __pyx_obj_7sweepea__TableFunctionImpl *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "sweepea.pyx":505
 * 
 *     def __dealloc__(self):
 *         Py_DECREF(self)             # <<<<<<<<<<<<<<
 * 
 *     cdef create_module(self, pysqlite_Connection* sqlite_conn):
 */
  Py_DECREF(((PyObject *)__pyx_v_self));

  /* "sweepea.pyx":504
 *         self.table_function = table_function
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         Py_DECREF(self)
 * 
 */

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

/* "sweepea.pyx":507
 *         Py_DECREF(self)
 * 
 *     cdef create_module(self, pysqlite_Connection* sqlite_conn):             # <<<<<<<<<<<<<<
 *         cdef:
 *             sqlite3 *db = sqlite_conn.db
 */

static PyObject *__pyx_f_7sweepea_18_TableFunctionImpl_create_module(struct __pyx_obj_7sweepea__TableFunctionImpl *__pyx_v_self, pysqlite_Connection *__pyx_v_sqlite_conn) {
  sqlite3 *__pyx_v_db;
  int __pyx_v_rc;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  sqlite3 *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  char const *__pyx_t_3;
  __Pyx_RefNannySetupContext("create_module", 0);

  /* "sweepea.pyx":509
 *     cdef create_module(self, pysqlite_Connection* sqlite_conn):
 *         cdef:
 *             sqlite3 *db = sqlite_conn.db             # <<<<<<<<<<<<<<
 *             int rc
 * 
 */
  __pyx_t_1 = __pyx_v_sqlite_conn->db;
  __pyx_v_db = __pyx_t_1;

  /* "sweepea.pyx":513
 * 
 *         # Populate the SQLite module struct members.
 *         self.module.iVersion = 0             # <<<<<<<<<<<<<<
 *         self.module.xCreate = NULL
 *         self.module.xConnect = pwConnect
 */
  __pyx_v_self->module.iVersion = 0;

  /* "sweepea.pyx":514
 *         # Populate the SQLite module struct members.
 *         self.module.iVersion = 0
 *         self.module.xCreate = NULL             # <<<<<<<<<<<<<<
 *         self.module.xConnect = pwConnect
 *         self.module.xBestIndex = pwBestIndex
 */
  __pyx_v_self->module.xCreate = NULL;

  /* "sweepea.pyx":515
 *         self.module.iVersion = 0
 *         self.module.xCreate = NULL
 *         self.module.xConnect = pwConnect             # <<<<<<<<<<<<<<
 *         self.module.xBestIndex = pwBestIndex
 *         self.module.xDisconnect = pwDisconnect
 */
  __pyx_v_self->module.xConnect = __pyx_f_7sweepea_pwConnect;

  /* "sweepea.pyx":516
 *         self.module.xCreate = NULL
 *         self.module.xConnect = pwConnect
 *         self.module.xBestIndex = pwBestIndex             # <<<<<<<<<<<<<<
 *         self.module.xDisconnect = pwDisconnect
 *         self.module.xDestroy = NULL
 */
  __pyx_v_self->module.xBestIndex = __pyx_f_7sweepea_pwBestIndex;

  /* "sweepea.pyx":517
 *         self.module.xConnect = pwConnect
 *         self.module.xBestIndex = pwBestIndex
 *         self.module.xDisconnect = pwDisconnect             # <<<<<<<<<<<<<<
 *         self.module.xDestroy = NULL
 *         self.module.xOpen = pwOpen
 */
  __pyx_v_self->module.xDisconnect = __pyx_f_7sweepea_pwDisconnect;

  /* "sweepea.pyx":518
 *         self.module.xBestIndex = pwBestIndex
 *         self.module.xDisconnect = pwDisconnect
 *         self.module.xDestroy = NULL             # <<<<<<<<<<<<<<
 *         self.module.xOpen = pwOpen
 *         self.module.xClose = pwClose
 */
  __pyx_v_self->module.xDestroy = NULL;

  /* "sweepea.pyx":519
 *         self.module.xDisconnect = pwDisconnect
 *         self.module.xDestroy = NULL
 *         self.module.xOpen = pwOpen             # <<<<<<<<<<<<<<
 *         self.module.xClose = pwClose
 *         self.module.xFilter = pwFilter
 */
  __pyx_v_self->module.xOpen = __pyx_f_7sweepea_pwOpen;

  /* "sweepea.pyx":520
 *         self.module.xDestroy = NULL
 *         self.module.xOpen = pwOpen
 *         self.module.xClose = pwClose             # <<<<<<<<<<<<<<
 *         self.module.xFilter = pwFilter
 *         self.module.xNext = pwNext
 */
  __pyx_v_self->module.xClose = __pyx_f_7sweepea_pwClose;

  /* "sweepea.pyx":521
 *         self.module.xOpen = pwOpen
 *         self.module.xClose = pwClose
 *         self.module.xFilter = pwFilter             # <<<<<<<<<<<<<<
 *         self.module.xNext = pwNext
 *         self.module.xEof = pwEof
 */
  __pyx_v_self->module.xFilter = __pyx_f_7sweepea_pwFilter;

  /* "sweepea.pyx":522
 *         self.module.xClose = pwClose
 *         self.module.xFilter = pwFilter
 *         self.module.xNext = pwNext             # <<<<<<<<<<<<<<
 *         self.module.xEof = pwEof
 *         self.module.xColumn = pwColumn
 */
  __pyx_v_self->module.xNext = __pyx_f_7sweepea_pwNext;

  /* "sweepea.pyx":523
 *         self.module.xFilter = pwFilter
 *         self.module.xNext = pwNext
 *         self.module.xEof = pwEof             # <<<<<<<<<<<<<<
 *         self.module.xColumn = pwColumn
 *         self.module.xRowid = pwRowid
 */
  __pyx_v_self->module.xEof = __pyx_f_7sweepea_pwEof;

  /* "sweepea.pyx":524
 *         self.module.xNext = pwNext
 *         self.module.xEof = pwEof
 *         self.module.xColumn = pwColumn             # <<<<<<<<<<<<<<
 *         self.module.xRowid = pwRowid
 *         self.module.xUpdate = NULL
 */
  __pyx_v_self->module.xColumn = __pyx_f_7sweepea_pwColumn;

  /* "sweepea.pyx":525
 *         self.module.xEof = pwEof
 *         self.module.xColumn = pwColumn
 *         self.module.xRowid = pwRowid             # <<<<<<<<<<<<<<
 *         self.module.xUpdate = NULL
 *         self.module.xBegin = NULL
 */
  __pyx_v_self->module.xRowid = __pyx_f_7sweepea_pwRowid;

  /* "sweepea.pyx":526
 *         self.module.xColumn = pwColumn
 *         self.module.xRowid = pwRowid
 *         self.module.xUpdate = NULL             # <<<<<<<<<<<<<<
 *         self.module.xBegin = NULL
 *         self.module.xSync = NULL
 */
  __pyx_v_self->module.xUpdate = NULL;

  /* "sweepea.pyx":527
 *         self.module.xRowid = pwRowid
 *         self.module.xUpdate = NULL
 *         self.module.xBegin = NULL             # <<<<<<<<<<<<<<
 *         self.module.xSync = NULL
 *         self.module.xCommit = NULL
 */
  __pyx_v_self->module.xBegin = NULL;

  /* "sweepea.pyx":528
 *         self.module.xUpdate = NULL
 *         self.module.xBegin = NULL
 *         self.module.xSync = NULL             # <<<<<<<<<<<<<<
 *         self.module.xCommit = NULL
 *         self.module.xRollback = NULL
 */
  __pyx_v_self->module.xSync = NULL;

  /* "sweepea.pyx":529
 *         self.module.xBegin = NULL
 *         self.module.xSync = NULL
 *         self.module.xCommit = NULL             # <<<<<<<<<<<<<<
 *         self.module.xRollback = NULL
 *         self.module.xFindFunction = NULL
 */
  __pyx_v_self->module.xCommit = NULL;

  /* "sweepea.pyx":530
 *         self.module.xSync = NULL
 *         self.module.xCommit = NULL
 *         self.module.xRollback = NULL             # <<<<<<<<<<<<<<
 *         self.module.xFindFunction = NULL
 *         self.module.xRename = NULL
 */
  __pyx_v_self->module.xRollback = NULL;

  /* "sweepea.pyx":531
 *         self.module.xCommit = NULL
 *         self.module.xRollback = NULL
 *         self.module.xFindFunction = NULL             # <<<<<<<<<<<<<<
 *         self.module.xRename = NULL
 * 
 */
  __pyx_v_self->module.xFindFunction = NULL;

  /* "sweepea.pyx":532
 *         self.module.xRollback = NULL
 *         self.module.xFindFunction = NULL
 *         self.module.xRename = NULL             # <<<<<<<<<<<<<<
 * 
 *         # Create the SQLite virtual table.
 */
  __pyx_v_self->module.xRename = NULL;

  /* "sweepea.pyx":537
 *         rc = sqlite3_create_module(
 *             db,
 *             <const char *>self.table_function.name,             # <<<<<<<<<<<<<<
 *             &self.module,
 *             <void *>(self.table_function))
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->table_function, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 537, __pyx_L1_error)

  /* "sweepea.pyx":535
 * 
 *         # Create the SQLite virtual table.
 *         rc = sqlite3_create_module(             # <<<<<<<<<<<<<<
 *             db,
 *             <const char *>self.table_function.name,
 */
  __pyx_v_rc = sqlite3_create_module(__pyx_v_db, ((char const *)__pyx_t_3), (&__pyx_v_self->module), ((void *)__pyx_v_self->table_function));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":541
 *             <void *>(self.table_function))
 * 
 *         Py_INCREF(self)             # <<<<<<<<<<<<<<
 * 
 *         return rc == SQLITE_OK
 */
  Py_INCREF(((PyObject *)__pyx_v_self));

  /* "sweepea.pyx":543
 *         Py_INCREF(self)
 * 
 *         return rc == SQLITE_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyBool_FromLong((__pyx_v_rc == SQLITE_OK)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":507
 *         Py_DECREF(self)
 * 
 *     cdef create_module(self, pysqlite_Connection* sqlite_conn):             # <<<<<<<<<<<<<<
 *         cdef:
 *             sqlite3 *db = sqlite_conn.db
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("sweepea._TableFunctionImpl.create_module", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":570
 * 
 *     @classmethod
 *     def register(cls, conn):             # <<<<<<<<<<<<<<
 *         cdef _TableFunctionImpl impl = _TableFunctionImpl(cls)
 *         impl.create_module(<pysqlite_Connection *>conn)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_13TableFunction_1register(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_13TableFunction_1register = {"register", (PyCFunction)__pyx_pw_7sweepea_13TableFunction_1register, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_13TableFunction_1register(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cls = 0;
  PyObject *__pyx_v_conn = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("register (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cls,&__pyx_n_s_conn,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_cls)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_conn)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("register", 1, 2, 2, 1); __PYX_ERR(0, 570, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "register") < 0)) __PYX_ERR(0, 570, __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_cls = values[0];
    __pyx_v_conn = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("register", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 570, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.TableFunction.register", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_13TableFunction_register(__pyx_self, __pyx_v_cls, __pyx_v_conn);

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

static PyObject *__pyx_pf_7sweepea_13TableFunction_register(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls, PyObject *__pyx_v_conn) {
  struct __pyx_obj_7sweepea__TableFunctionImpl *__pyx_v_impl = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  __Pyx_RefNannySetupContext("register", 0);

  /* "sweepea.pyx":571
 *     @classmethod
 *     def register(cls, conn):
 *         cdef _TableFunctionImpl impl = _TableFunctionImpl(cls)             # <<<<<<<<<<<<<<
 *         impl.create_module(<pysqlite_Connection *>conn)
 *         cls._ncols = len(cls.columns)
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_cls);
  __Pyx_GIVEREF(__pyx_v_cls);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cls);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea__TableFunctionImpl), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_impl = ((struct __pyx_obj_7sweepea__TableFunctionImpl *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "sweepea.pyx":572
 *     def register(cls, conn):
 *         cdef _TableFunctionImpl impl = _TableFunctionImpl(cls)
 *         impl.create_module(<pysqlite_Connection *>conn)             # <<<<<<<<<<<<<<
 *         cls._ncols = len(cls.columns)
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea__TableFunctionImpl *)__pyx_v_impl->__pyx_vtab)->create_module(__pyx_v_impl, ((pysqlite_Connection *)__pyx_v_conn)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":573
 *         cdef _TableFunctionImpl impl = _TableFunctionImpl(cls)
 *         impl.create_module(<pysqlite_Connection *>conn)
 *         cls._ncols = len(cls.columns)             # <<<<<<<<<<<<<<
 * 
 *     def initialize(self, **filters):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_cls, __pyx_n_s_ncols, __pyx_t_2) < 0) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":570
 * 
 *     @classmethod
 *     def register(cls, conn):             # <<<<<<<<<<<<<<
 *         cdef _TableFunctionImpl impl = _TableFunctionImpl(cls)
 *         impl.create_module(<pysqlite_Connection *>conn)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("sweepea.TableFunction.register", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_impl);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":575
 *         cls._ncols = len(cls.columns)
 * 
 *     def initialize(self, **filters):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_13TableFunction_3initialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_13TableFunction_3initialize = {"initialize", (PyCFunction)__pyx_pw_7sweepea_13TableFunction_3initialize, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_13TableFunction_3initialize(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_filters = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize (wrapper)", 0);
  __pyx_v_filters = PyDict_New(); if (unlikely(!__pyx_v_filters)) return NULL;
  __Pyx_GOTREF(__pyx_v_filters);
  {
    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) {
        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;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_filters, values, pos_args, "initialize") < 0)) __PYX_ERR(0, 575, __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("initialize", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 575, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_filters); __pyx_v_filters = 0;
  __Pyx_AddTraceback("sweepea.TableFunction.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_13TableFunction_2initialize(__pyx_self, __pyx_v_self, __pyx_v_filters);

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

static PyObject *__pyx_pf_7sweepea_13TableFunction_2initialize(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_filters) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize", 0);

  /* "sweepea.pyx":576
 * 
 *     def initialize(self, **filters):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     def iterate(self, idx):
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(0, 576, __pyx_L1_error)

  /* "sweepea.pyx":575
 *         cls._ncols = len(cls.columns)
 * 
 *     def initialize(self, **filters):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("sweepea.TableFunction.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":578
 *         raise NotImplementedError
 * 
 *     def iterate(self, idx):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_13TableFunction_5iterate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_13TableFunction_5iterate = {"iterate", (PyCFunction)__pyx_pw_7sweepea_13TableFunction_5iterate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_13TableFunction_5iterate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_idx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iterate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_idx,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_idx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("iterate", 1, 2, 2, 1); __PYX_ERR(0, 578, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "iterate") < 0)) __PYX_ERR(0, 578, __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_idx = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("iterate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 578, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.TableFunction.iterate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_13TableFunction_4iterate(__pyx_self, __pyx_v_self, __pyx_v_idx);

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

static PyObject *__pyx_pf_7sweepea_13TableFunction_4iterate(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_idx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iterate", 0);

  /* "sweepea.pyx":579
 * 
 *     def iterate(self, idx):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(0, 579, __pyx_L1_error)

  /* "sweepea.pyx":578
 *         raise NotImplementedError
 * 
 *     def iterate(self, idx):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("sweepea.TableFunction.iterate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":582
 * 
 *     @classmethod
 *     def get_table_columns_declaration(cls):             # <<<<<<<<<<<<<<
 *         cdef list accum = []
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_13TableFunction_7get_table_columns_declaration(PyObject *__pyx_self, PyObject *__pyx_v_cls); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_13TableFunction_7get_table_columns_declaration = {"get_table_columns_declaration", (PyCFunction)__pyx_pw_7sweepea_13TableFunction_7get_table_columns_declaration, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_13TableFunction_7get_table_columns_declaration(PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_table_columns_declaration (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_13TableFunction_6get_table_columns_declaration(__pyx_self, ((PyObject *)__pyx_v_cls));

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

static PyObject *__pyx_pf_7sweepea_13TableFunction_6get_table_columns_declaration(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cls) {
  PyObject *__pyx_v_accum = 0;
  PyObject *__pyx_v_column = NULL;
  PyObject *__pyx_v_param = 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 *);
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("get_table_columns_declaration", 0);

  /* "sweepea.pyx":583
 *     @classmethod
 *     def get_table_columns_declaration(cls):
 *         cdef list accum = []             # <<<<<<<<<<<<<<
 * 
 *         for column in cls.columns:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_accum = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":585
 *         cdef list accum = []
 * 
 *         for column in cls.columns:             # <<<<<<<<<<<<<<
 *             if isinstance(column, tuple):
 *                 if len(column) != 2:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 585, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 585, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 585, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        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, 585, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_column, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "sweepea.pyx":586
 * 
 *         for column in cls.columns:
 *             if isinstance(column, tuple):             # <<<<<<<<<<<<<<
 *                 if len(column) != 2:
 *                     raise ValueError('Column must be either a string or a '
 */
    __pyx_t_5 = PyTuple_Check(__pyx_v_column); 
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {

      /* "sweepea.pyx":587
 *         for column in cls.columns:
 *             if isinstance(column, tuple):
 *                 if len(column) != 2:             # <<<<<<<<<<<<<<
 *                     raise ValueError('Column must be either a string or a '
 *                                      '2-tuple of name, type')
 */
      __pyx_t_7 = PyObject_Length(__pyx_v_column); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 587, __pyx_L1_error)
      __pyx_t_6 = ((__pyx_t_7 != 2) != 0);
      if (__pyx_t_6) {

        /* "sweepea.pyx":588
 *             if isinstance(column, tuple):
 *                 if len(column) != 2:
 *                     raise ValueError('Column must be either a string or a '             # <<<<<<<<<<<<<<
 *                                      '2-tuple of name, type')
 *                 accum.append('%s %s' % column)
 */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __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, 588, __pyx_L1_error)

        /* "sweepea.pyx":587
 *         for column in cls.columns:
 *             if isinstance(column, tuple):
 *                 if len(column) != 2:             # <<<<<<<<<<<<<<
 *                     raise ValueError('Column must be either a string or a '
 *                                      '2-tuple of name, type')
 */
      }

      /* "sweepea.pyx":590
 *                     raise ValueError('Column must be either a string or a '
 *                                      '2-tuple of name, type')
 *                 accum.append('%s %s' % column)             # <<<<<<<<<<<<<<
 *             else:
 *                 accum.append(column)
 */
      __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_s, __pyx_v_column); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_accum, __pyx_t_1); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 590, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "sweepea.pyx":586
 * 
 *         for column in cls.columns:
 *             if isinstance(column, tuple):             # <<<<<<<<<<<<<<
 *                 if len(column) != 2:
 *                     raise ValueError('Column must be either a string or a '
 */
      goto __pyx_L5;
    }

    /* "sweepea.pyx":592
 *                 accum.append('%s %s' % column)
 *             else:
 *                 accum.append(column)             # <<<<<<<<<<<<<<
 * 
 *         for param in cls.params:
 */
    /*else*/ {
      __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_accum, __pyx_v_column); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 592, __pyx_L1_error)
    }
    __pyx_L5:;

    /* "sweepea.pyx":585
 *         cdef list accum = []
 * 
 *         for column in cls.columns:             # <<<<<<<<<<<<<<
 *             if isinstance(column, tuple):
 *                 if len(column) != 2:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":594
 *                 accum.append(column)
 * 
 *         for param in cls.params:             # <<<<<<<<<<<<<<
 *             accum.append('%s HIDDEN' % param)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cls, __pyx_n_s_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  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, 594, __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, 594, __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_COMPILING_IN_CPYTHON
        __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, 594, __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, 594, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __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, 594, __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, 594, __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, 594, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "sweepea.pyx":595
 * 
 *         for param in cls.params:
 *             accum.append('%s HIDDEN' % param)             # <<<<<<<<<<<<<<
 * 
 *         return ', '.join(accum)
 */
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_s_HIDDEN, __pyx_v_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_accum, __pyx_t_2); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 595, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":594
 *                 accum.append(column)
 * 
 *         for param in cls.params:             # <<<<<<<<<<<<<<
 *             accum.append('%s HIDDEN' % param)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":597
 *             accum.append('%s HIDDEN' % param)
 * 
 *         return ', '.join(accum)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__5, __pyx_v_accum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":582
 * 
 *     @classmethod
 *     def get_table_columns_declaration(cls):             # <<<<<<<<<<<<<<
 *         cdef list accum = []
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("sweepea.TableFunction.get_table_columns_declaration", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_accum);
  __Pyx_XDECREF(__pyx_v_column);
  __Pyx_XDECREF(__pyx_v_param);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":600
 * 
 * 
 * cdef list _parse_match_info(object buf):             # <<<<<<<<<<<<<<
 *     # See http://sqlite.org/fts3.html#matchinfo
 *     cdef:
 */

static PyObject *__pyx_f_7sweepea__parse_match_info(PyObject *__pyx_v_buf) {
  int __pyx_v_bufsize;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("_parse_match_info", 0);

  /* "sweepea.pyx":603
 *     # See http://sqlite.org/fts3.html#matchinfo
 *     cdef:
 *         int bufsize = len(buf), i             # <<<<<<<<<<<<<<
 * 
 *     bufsize = len(buf)  # Length in bytes.
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_buf); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 603, __pyx_L1_error)
  __pyx_v_bufsize = __pyx_t_1;

  /* "sweepea.pyx":605
 *         int bufsize = len(buf), i
 * 
 *     bufsize = len(buf)  # Length in bytes.             # <<<<<<<<<<<<<<
 *     return [struct.unpack('@I', buf[i:i+4])[0] for i in range(0, bufsize, 4)]
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_buf); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 605, __pyx_L1_error)
  __pyx_v_bufsize = __pyx_t_1;

  /* "sweepea.pyx":606
 * 
 *     bufsize = len(buf)  # Length in bytes.
 *     return [struct.unpack('@I', buf[i:i+4])[0] for i in range(0, bufsize, 4)]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_v_bufsize;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=4) {
    __pyx_v_i = __pyx_t_4;
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_struct); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_unpack); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_v_buf, __pyx_v_i, (__pyx_v_i + 4), NULL, NULL, NULL, 1, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = NULL;
    __pyx_t_1 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
        __pyx_t_1 = 1;
      }
    }
    __pyx_t_9 = PyTuple_New(2+__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_s_I);
    __Pyx_GIVEREF(__pyx_kp_s_I);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_1, __pyx_kp_s_I);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_1, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":600
 * 
 * 
 * cdef list _parse_match_info(object buf):             # <<<<<<<<<<<<<<
 *     # See http://sqlite.org/fts3.html#matchinfo
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("sweepea._parse_match_info", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":609
 * 
 * 
 * cdef float rank(object raw_match_info):             # <<<<<<<<<<<<<<
 *     # Ranking implementation, which parse matchinfo.
 *     cdef:
 */

static float __pyx_f_7sweepea_rank(PyObject *__pyx_v_raw_match_info) {
  float __pyx_v_score;
  int __pyx_v_p;
  int __pyx_v_c;
  int __pyx_v_phrase_num;
  int __pyx_v_col_num;
  int __pyx_v_col_idx;
  int __pyx_v_x1;
  int __pyx_v_x2;
  PyObject *__pyx_v_match_info = 0;
  PyObject *__pyx_v_phrase_info_idx = NULL;
  float __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("rank", 0);

  /* "sweepea.pyx":612
 *     # Ranking implementation, which parse matchinfo.
 *     cdef:
 *         float score = 0.0             # <<<<<<<<<<<<<<
 *         int p, c, phrase_num, col_num, col_idx, x1, x2
 *         list match_info
 */
  __pyx_v_score = 0.0;

  /* "sweepea.pyx":617
 *     # Handle match_info called w/default args 'pcx' - based on the example rank
 *     # function http://sqlite.org/fts3.html#appendix_a
 *     match_info = _parse_match_info(raw_match_info)             # <<<<<<<<<<<<<<
 *     p, c = match_info[:2]
 *     for phrase_num in range(p):
 */
  __pyx_t_1 = __pyx_f_7sweepea__parse_match_info(__pyx_v_raw_match_info); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_match_info = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":618
 *     # function http://sqlite.org/fts3.html#appendix_a
 *     match_info = _parse_match_info(raw_match_info)
 *     p, c = match_info[:2]             # <<<<<<<<<<<<<<
 *     for phrase_num in range(p):
 *         phrase_info_idx = 2 + (phrase_num * c * 3)
 */
  if (unlikely(__pyx_v_match_info == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 618, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyList_GetSlice(__pyx_v_match_info, 0, 2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (1) {
    PyObject* sequence = __pyx_t_1;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 618, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __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, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_p = __pyx_t_4;
  __pyx_v_c = __pyx_t_5;

  /* "sweepea.pyx":619
 *     match_info = _parse_match_info(raw_match_info)
 *     p, c = match_info[:2]
 *     for phrase_num in range(p):             # <<<<<<<<<<<<<<
 *         phrase_info_idx = 2 + (phrase_num * c * 3)
 *         for col_num in range(c):
 */
  __pyx_t_5 = __pyx_v_p;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4+=1) {
    __pyx_v_phrase_num = __pyx_t_4;

    /* "sweepea.pyx":620
 *     p, c = match_info[:2]
 *     for phrase_num in range(p):
 *         phrase_info_idx = 2 + (phrase_num * c * 3)             # <<<<<<<<<<<<<<
 *         for col_num in range(c):
 *             col_idx = phrase_info_idx + (col_num * 3)
 */
    __pyx_t_1 = __Pyx_PyInt_From_long((2 + ((__pyx_v_phrase_num * __pyx_v_c) * 3))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_phrase_info_idx, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "sweepea.pyx":621
 *     for phrase_num in range(p):
 *         phrase_info_idx = 2 + (phrase_num * c * 3)
 *         for col_num in range(c):             # <<<<<<<<<<<<<<
 *             col_idx = phrase_info_idx + (col_num * 3)
 *             x1, x2 = match_info[col_idx:col_idx + 2]
 */
    __pyx_t_6 = __pyx_v_c;
    for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
      __pyx_v_col_num = __pyx_t_7;

      /* "sweepea.pyx":622
 *         phrase_info_idx = 2 + (phrase_num * c * 3)
 *         for col_num in range(c):
 *             col_idx = phrase_info_idx + (col_num * 3)             # <<<<<<<<<<<<<<
 *             x1, x2 = match_info[col_idx:col_idx + 2]
 *             if x1 > 0:
 */
      __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_col_num * 3)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_3 = PyNumber_Add(__pyx_v_phrase_info_idx, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 622, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_col_idx = __pyx_t_8;

      /* "sweepea.pyx":623
 *         for col_num in range(c):
 *             col_idx = phrase_info_idx + (col_num * 3)
 *             x1, x2 = match_info[col_idx:col_idx + 2]             # <<<<<<<<<<<<<<
 *             if x1 > 0:
 *                 score += float(x1) / x2
 */
      if (unlikely(__pyx_v_match_info == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 623, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyList_GetSlice(__pyx_v_match_info, __pyx_v_col_idx, (__pyx_v_col_idx + 2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (1) {
        PyObject* sequence = __pyx_t_3;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 623, __pyx_L1_error)
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        #else
        __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 623, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 623, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_x1 = __pyx_t_8;
      __pyx_v_x2 = __pyx_t_9;

      /* "sweepea.pyx":624
 *             col_idx = phrase_info_idx + (col_num * 3)
 *             x1, x2 = match_info[col_idx:col_idx + 2]
 *             if x1 > 0:             # <<<<<<<<<<<<<<
 *                 score += float(x1) / x2
 *     return score
 */
      __pyx_t_10 = ((__pyx_v_x1 > 0) != 0);
      if (__pyx_t_10) {

        /* "sweepea.pyx":625
 *             x1, x2 = match_info[col_idx:col_idx + 2]
 *             if x1 > 0:
 *                 score += float(x1) / x2             # <<<<<<<<<<<<<<
 *     return score
 * 
 */
        if (unlikely(__pyx_v_x2 == 0)) {
          PyErr_SetString(PyExc_ZeroDivisionError, "float division");
          __PYX_ERR(0, 625, __pyx_L1_error)
        }
        __pyx_v_score = (__pyx_v_score + (((double)__pyx_v_x1) / __pyx_v_x2));

        /* "sweepea.pyx":624
 *             col_idx = phrase_info_idx + (col_num * 3)
 *             x1, x2 = match_info[col_idx:col_idx + 2]
 *             if x1 > 0:             # <<<<<<<<<<<<<<
 *                 score += float(x1) / x2
 *     return score
 */
      }
    }
  }

  /* "sweepea.pyx":626
 *             if x1 > 0:
 *                 score += float(x1) / x2
 *     return score             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_score;
  goto __pyx_L0;

  /* "sweepea.pyx":609
 * 
 * 
 * cdef float rank(object raw_match_info):             # <<<<<<<<<<<<<<
 *     # Ranking implementation, which parse matchinfo.
 *     cdef:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("sweepea.rank", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_match_info);
  __Pyx_XDECREF(__pyx_v_phrase_info_idx);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":629
 * 
 * 
 * cdef float bm25(object raw_match_info, int column_index, float k1, float b):             # <<<<<<<<<<<<<<
 *     """
 *     Okapi BM25 ranking implementation (FTS4 only).
 */

static float __pyx_f_7sweepea_bm25(PyObject *__pyx_v_raw_match_info, int __pyx_v_column_index, float __pyx_v_k1, float __pyx_v_b) {
  float __pyx_v_avg_length;
  float __pyx_v_doc_length;
  float __pyx_v_D;
  float __pyx_v_term_freq;
  float __pyx_v_term_matches;
  float __pyx_v_idf;
  float __pyx_v_denom;
  float __pyx_v_rhs;
  float __pyx_v_score;
  int __pyx_v_p;
  int __pyx_v_c;
  int __pyx_v_n_idx;
  int __pyx_v_a_idx;
  int __pyx_v_l_idx;
  int __pyx_v_n;
  int __pyx_v_total_docs;
  int __pyx_v_x_idx;
  PyObject *__pyx_v_match_info = 0;
  PyObject *__pyx_v_a = 0;
  PyObject *__pyx_v_l = 0;
  PyObject *__pyx_v_phrase = NULL;
  float __pyx_r;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  double __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  long __pyx_t_12;
  double __pyx_t_13;
  double __pyx_t_14;
  __Pyx_RefNannySetupContext("bm25", 0);

  /* "sweepea.pyx":644
 *         list match_info, a, l
 * 
 *     k1 = k1 or 1.2             # <<<<<<<<<<<<<<
 *     b = b or 0.75
 *     match_info = _parse_match_info(raw_match_info)
 */
  if (!__pyx_v_k1) {
  } else {
    __pyx_t_1 = __pyx_v_k1;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_1 = 1.2;
  __pyx_L3_bool_binop_done:;
  __pyx_v_k1 = __pyx_t_1;

  /* "sweepea.pyx":645
 * 
 *     k1 = k1 or 1.2
 *     b = b or 0.75             # <<<<<<<<<<<<<<
 *     match_info = _parse_match_info(raw_match_info)
 *     score = 0.0
 */
  if (!__pyx_v_b) {
  } else {
    __pyx_t_1 = __pyx_v_b;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = 0.75;
  __pyx_L5_bool_binop_done:;
  __pyx_v_b = __pyx_t_1;

  /* "sweepea.pyx":646
 *     k1 = k1 or 1.2
 *     b = b or 0.75
 *     match_info = _parse_match_info(raw_match_info)             # <<<<<<<<<<<<<<
 *     score = 0.0
 *     # p, 1 --> num terms
 */
  __pyx_t_2 = __pyx_f_7sweepea__parse_match_info(__pyx_v_raw_match_info); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 646, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_match_info = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "sweepea.pyx":647
 *     b = b or 0.75
 *     match_info = _parse_match_info(raw_match_info)
 *     score = 0.0             # <<<<<<<<<<<<<<
 *     # p, 1 --> num terms
 *     # c, 1 --> num cols
 */
  __pyx_v_score = 0.0;

  /* "sweepea.pyx":658
 *     # l, c --> for each column, length of value for this column (in this row)
 *     # s, c --> ignore
 *     p, c = match_info[:2]             # <<<<<<<<<<<<<<
 *     n_idx = 2 + (3 * p * c)
 *     a_idx = n_idx + 1
 */
  if (unlikely(__pyx_v_match_info == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 658, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_match_info, 0, 2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (1) {
    PyObject* sequence = __pyx_t_2;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 658, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyList_GET_ITEM(sequence, 0); 
    __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_p = __pyx_t_5;
  __pyx_v_c = __pyx_t_6;

  /* "sweepea.pyx":659
 *     # s, c --> ignore
 *     p, c = match_info[:2]
 *     n_idx = 2 + (3 * p * c)             # <<<<<<<<<<<<<<
 *     a_idx = n_idx + 1
 *     l_idx = a_idx + c
 */
  __pyx_v_n_idx = (2 + ((3 * __pyx_v_p) * __pyx_v_c));

  /* "sweepea.pyx":660
 *     p, c = match_info[:2]
 *     n_idx = 2 + (3 * p * c)
 *     a_idx = n_idx + 1             # <<<<<<<<<<<<<<
 *     l_idx = a_idx + c
 *     n = match_info[n_idx]
 */
  __pyx_v_a_idx = (__pyx_v_n_idx + 1);

  /* "sweepea.pyx":661
 *     n_idx = 2 + (3 * p * c)
 *     a_idx = n_idx + 1
 *     l_idx = a_idx + c             # <<<<<<<<<<<<<<
 *     n = match_info[n_idx]
 *     a = match_info[a_idx: a_idx + c]
 */
  __pyx_v_l_idx = (__pyx_v_a_idx + __pyx_v_c);

  /* "sweepea.pyx":662
 *     a_idx = n_idx + 1
 *     l_idx = a_idx + c
 *     n = match_info[n_idx]             # <<<<<<<<<<<<<<
 *     a = match_info[a_idx: a_idx + c]
 *     l = match_info[l_idx: l_idx + c]
 */
  if (unlikely(__pyx_v_match_info == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 662, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_match_info, __pyx_v_n_idx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 662, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_n = __pyx_t_6;

  /* "sweepea.pyx":663
 *     l_idx = a_idx + c
 *     n = match_info[n_idx]
 *     a = match_info[a_idx: a_idx + c]             # <<<<<<<<<<<<<<
 *     l = match_info[l_idx: l_idx + c]
 * 
 */
  if (unlikely(__pyx_v_match_info == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 663, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_match_info, __pyx_v_a_idx, (__pyx_v_a_idx + __pyx_v_c)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_a = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "sweepea.pyx":664
 *     n = match_info[n_idx]
 *     a = match_info[a_idx: a_idx + c]
 *     l = match_info[l_idx: l_idx + c]             # <<<<<<<<<<<<<<
 * 
 *     total_docs = n
 */
  if (unlikely(__pyx_v_match_info == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 664, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_match_info, __pyx_v_l_idx, (__pyx_v_l_idx + __pyx_v_c)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 664, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_l = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "sweepea.pyx":666
 *     l = match_info[l_idx: l_idx + c]
 * 
 *     total_docs = n             # <<<<<<<<<<<<<<
 *     avg_length = float(a[column_index])
 *     doc_length = float(l[column_index])
 */
  __pyx_v_total_docs = __pyx_v_n;

  /* "sweepea.pyx":667
 * 
 *     total_docs = n
 *     avg_length = float(a[column_index])             # <<<<<<<<<<<<<<
 *     doc_length = float(l[column_index])
 *     if avg_length == 0:
 */
  __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_a, __pyx_v_column_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_t_2); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 667, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_avg_length = __pyx_t_7;

  /* "sweepea.pyx":668
 *     total_docs = n
 *     avg_length = float(a[column_index])
 *     doc_length = float(l[column_index])             # <<<<<<<<<<<<<<
 *     if avg_length == 0:
 *         D = 0
 */
  __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_l, __pyx_v_column_index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_t_2); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 668, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_doc_length = __pyx_t_7;

  /* "sweepea.pyx":669
 *     avg_length = float(a[column_index])
 *     doc_length = float(l[column_index])
 *     if avg_length == 0:             # <<<<<<<<<<<<<<
 *         D = 0
 *     else:
 */
  __pyx_t_8 = ((__pyx_v_avg_length == 0.0) != 0);
  if (__pyx_t_8) {

    /* "sweepea.pyx":670
 *     doc_length = float(l[column_index])
 *     if avg_length == 0:
 *         D = 0             # <<<<<<<<<<<<<<
 *     else:
 *         D = 1 - b + (b * (doc_length / avg_length))
 */
    __pyx_v_D = 0.0;

    /* "sweepea.pyx":669
 *     avg_length = float(a[column_index])
 *     doc_length = float(l[column_index])
 *     if avg_length == 0:             # <<<<<<<<<<<<<<
 *         D = 0
 *     else:
 */
    goto __pyx_L7;
  }

  /* "sweepea.pyx":672
 *         D = 0
 *     else:
 *         D = 1 - b + (b * (doc_length / avg_length))             # <<<<<<<<<<<<<<
 * 
 *     for phrase in range(p):
 */
  /*else*/ {
    if (unlikely(__pyx_v_avg_length == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 672, __pyx_L1_error)
    }
    __pyx_v_D = ((1.0 - __pyx_v_b) + (__pyx_v_b * (__pyx_v_doc_length / __pyx_v_avg_length)));
  }
  __pyx_L7:;

  /* "sweepea.pyx":674
 *         D = 1 - b + (b * (doc_length / avg_length))
 * 
 *     for phrase in range(p):             # <<<<<<<<<<<<<<
 *         # p, c, p0c01, p0c02, p0c03, p0c11, p0c12, p0c13, p1c01, p1c02, p1c03..
 *         # So if we're interested in column <i>, the counts will be at indexes
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_p); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __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 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_9 = 0;
    __pyx_t_10 = NULL;
  } else {
    __pyx_t_9 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 674, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_10)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 674, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_9); __Pyx_INCREF(__pyx_t_2); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 674, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 674, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_10(__pyx_t_4);
      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, 674, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_phrase, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "sweepea.pyx":677
 *         # p, c, p0c01, p0c02, p0c03, p0c11, p0c12, p0c13, p1c01, p1c02, p1c03..
 *         # So if we're interested in column <i>, the counts will be at indexes
 *         x_idx = 2 + (3 * column_index * (phrase + 1))             # <<<<<<<<<<<<<<
 *         term_freq = float(match_info[x_idx])
 *         term_matches = float(match_info[x_idx + 2])
 */
    __pyx_t_2 = __Pyx_PyInt_From_long((3 * __pyx_v_column_index)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_phrase, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_AddCObj(__pyx_int_2, __pyx_t_11, 2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_x_idx = __pyx_t_6;

    /* "sweepea.pyx":678
 *         # So if we're interested in column <i>, the counts will be at indexes
 *         x_idx = 2 + (3 * column_index * (phrase + 1))
 *         term_freq = float(match_info[x_idx])             # <<<<<<<<<<<<<<
 *         term_matches = float(match_info[x_idx + 2])
 * 
 */
    if (unlikely(__pyx_v_match_info == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 678, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_match_info, __pyx_v_x_idx, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_t_3); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 678, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_term_freq = __pyx_t_7;

    /* "sweepea.pyx":679
 *         x_idx = 2 + (3 * column_index * (phrase + 1))
 *         term_freq = float(match_info[x_idx])
 *         term_matches = float(match_info[x_idx + 2])             # <<<<<<<<<<<<<<
 * 
 *         # The `max` check here is based on a suggestion in the Wikipedia
 */
    if (unlikely(__pyx_v_match_info == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 679, __pyx_L1_error)
    }
    __pyx_t_12 = (__pyx_v_x_idx + 2);
    __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_match_info, __pyx_t_12, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_AsDouble(__pyx_t_3); if (unlikely(__pyx_t_7 == ((double)-1) && PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_term_matches = __pyx_t_7;

    /* "sweepea.pyx":685
 *         # idf function can return negative values. Applying the max() here
 *         # weeds out those values.
 *         idf = max(             # <<<<<<<<<<<<<<
 *             log(
 *                 (total_docs - term_matches + 0.5) /
 */
    __pyx_t_12 = 0;

    /* "sweepea.pyx":687
 *         idf = max(
 *             log(
 *                 (total_docs - term_matches + 0.5) /             # <<<<<<<<<<<<<<
 *                 (term_matches + 0.5)),
 *             0)
 */
    __pyx_t_7 = ((__pyx_v_total_docs - __pyx_v_term_matches) + 0.5);

    /* "sweepea.pyx":688
 *             log(
 *                 (total_docs - term_matches + 0.5) /
 *                 (term_matches + 0.5)),             # <<<<<<<<<<<<<<
 *             0)
 * 
 */
    __pyx_t_13 = (__pyx_v_term_matches + 0.5);

    /* "sweepea.pyx":687
 *         idf = max(
 *             log(
 *                 (total_docs - term_matches + 0.5) /             # <<<<<<<<<<<<<<
 *                 (term_matches + 0.5)),
 *             0)
 */
    if (unlikely(__pyx_t_13 == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 687, __pyx_L1_error)
    }

    /* "sweepea.pyx":686
 *         # weeds out those values.
 *         idf = max(
 *             log(             # <<<<<<<<<<<<<<
 *                 (total_docs - term_matches + 0.5) /
 *                 (term_matches + 0.5)),
 */
    __pyx_t_14 = log((__pyx_t_7 / __pyx_t_13));

    /* "sweepea.pyx":689
 *                 (total_docs - term_matches + 0.5) /
 *                 (term_matches + 0.5)),
 *             0)             # <<<<<<<<<<<<<<
 * 
 *         denom = term_freq + (k1 * D)
 */
    if (((__pyx_t_12 > __pyx_t_14) != 0)) {
      __pyx_t_13 = __pyx_t_12;
    } else {
      __pyx_t_13 = __pyx_t_14;
    }
    __pyx_v_idf = __pyx_t_13;

    /* "sweepea.pyx":691
 *             0)
 * 
 *         denom = term_freq + (k1 * D)             # <<<<<<<<<<<<<<
 *         if denom == 0:
 *             rhs = 0
 */
    __pyx_v_denom = (__pyx_v_term_freq + (__pyx_v_k1 * __pyx_v_D));

    /* "sweepea.pyx":692
 * 
 *         denom = term_freq + (k1 * D)
 *         if denom == 0:             # <<<<<<<<<<<<<<
 *             rhs = 0
 *         else:
 */
    __pyx_t_8 = ((__pyx_v_denom == 0.0) != 0);
    if (__pyx_t_8) {

      /* "sweepea.pyx":693
 *         denom = term_freq + (k1 * D)
 *         if denom == 0:
 *             rhs = 0             # <<<<<<<<<<<<<<
 *         else:
 *             rhs = (term_freq * (k1 + 1)) / denom
 */
      __pyx_v_rhs = 0.0;

      /* "sweepea.pyx":692
 * 
 *         denom = term_freq + (k1 * D)
 *         if denom == 0:             # <<<<<<<<<<<<<<
 *             rhs = 0
 *         else:
 */
      goto __pyx_L10;
    }

    /* "sweepea.pyx":695
 *             rhs = 0
 *         else:
 *             rhs = (term_freq * (k1 + 1)) / denom             # <<<<<<<<<<<<<<
 * 
 *         score += (idf * rhs)
 */
    /*else*/ {
      __pyx_t_1 = (__pyx_v_term_freq * (__pyx_v_k1 + 1.0));
      if (unlikely(__pyx_v_denom == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        __PYX_ERR(0, 695, __pyx_L1_error)
      }
      __pyx_v_rhs = (__pyx_t_1 / __pyx_v_denom);
    }
    __pyx_L10:;

    /* "sweepea.pyx":697
 *             rhs = (term_freq * (k1 + 1)) / denom
 * 
 *         score += (idf * rhs)             # <<<<<<<<<<<<<<
 * 
 *     return score
 */
    __pyx_v_score = (__pyx_v_score + (__pyx_v_idf * __pyx_v_rhs));

    /* "sweepea.pyx":674
 *         D = 1 - b + (b * (doc_length / avg_length))
 * 
 *     for phrase in range(p):             # <<<<<<<<<<<<<<
 *         # p, c, p0c01, p0c02, p0c03, p0c11, p0c12, p0c13, p1c01, p1c02, p1c03..
 *         # So if we're interested in column <i>, the counts will be at indexes
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":699
 *         score += (idf * rhs)
 * 
 *     return score             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_score;
  goto __pyx_L0;

  /* "sweepea.pyx":629
 * 
 * 
 * cdef float bm25(object raw_match_info, int column_index, float k1, float b):             # <<<<<<<<<<<<<<
 *     """
 *     Okapi BM25 ranking implementation (FTS4 only).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_WriteUnraisable("sweepea.bm25", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_match_info);
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_phrase);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":702
 * 
 * 
 * cdef unsigned int murmurhash2(const char *key, int nlen, unsigned int seed):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unsigned int m = 0x5bd1e995
 */

static unsigned int __pyx_f_7sweepea_murmurhash2(char const *__pyx_v_key, int __pyx_v_nlen, unsigned int __pyx_v_seed) {
  unsigned int __pyx_v_m;
  int __pyx_v_r;
  unsigned int __pyx_v_l;
  unsigned char *__pyx_v_data;
  unsigned int __pyx_v_h;
  unsigned int __pyx_v_k;
  unsigned int __pyx_v_t;
  unsigned int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("murmurhash2", 0);

  /* "sweepea.pyx":704
 * cdef unsigned int murmurhash2(const char *key, int nlen, unsigned int seed):
 *     cdef:
 *         unsigned int m = 0x5bd1e995             # <<<<<<<<<<<<<<
 *         int r = 24
 *         unsigned int l = nlen
 */
  __pyx_v_m = 0x5bd1e995;

  /* "sweepea.pyx":705
 *     cdef:
 *         unsigned int m = 0x5bd1e995
 *         int r = 24             # <<<<<<<<<<<<<<
 *         unsigned int l = nlen
 *         unsigned char *data = <unsigned char *>key
 */
  __pyx_v_r = 24;

  /* "sweepea.pyx":706
 *         unsigned int m = 0x5bd1e995
 *         int r = 24
 *         unsigned int l = nlen             # <<<<<<<<<<<<<<
 *         unsigned char *data = <unsigned char *>key
 *         unsigned int h = seed
 */
  __pyx_v_l = __pyx_v_nlen;

  /* "sweepea.pyx":707
 *         int r = 24
 *         unsigned int l = nlen
 *         unsigned char *data = <unsigned char *>key             # <<<<<<<<<<<<<<
 *         unsigned int h = seed
 *         unsigned int k
 */
  __pyx_v_data = ((unsigned char *)__pyx_v_key);

  /* "sweepea.pyx":708
 *         unsigned int l = nlen
 *         unsigned char *data = <unsigned char *>key
 *         unsigned int h = seed             # <<<<<<<<<<<<<<
 *         unsigned int k
 *         unsigned int t = 0
 */
  __pyx_v_h = __pyx_v_seed;

  /* "sweepea.pyx":710
 *         unsigned int h = seed
 *         unsigned int k
 *         unsigned int t = 0             # <<<<<<<<<<<<<<
 * 
 *     while nlen >= 4:
 */
  __pyx_v_t = 0;

  /* "sweepea.pyx":712
 *         unsigned int t = 0
 * 
 *     while nlen >= 4:             # <<<<<<<<<<<<<<
 *         k = <unsigned int>(<unsigned int *>data)[0]
 * 
 */
  while (1) {
    __pyx_t_1 = ((__pyx_v_nlen >= 4) != 0);
    if (!__pyx_t_1) break;

    /* "sweepea.pyx":713
 * 
 *     while nlen >= 4:
 *         k = <unsigned int>(<unsigned int *>data)[0]             # <<<<<<<<<<<<<<
 * 
 *         # mmix(h, k).
 */
    __pyx_v_k = ((unsigned int)(((unsigned int *)__pyx_v_data)[0]));

    /* "sweepea.pyx":716
 * 
 *         # mmix(h, k).
 *         k *= m             # <<<<<<<<<<<<<<
 *         k = k ^ (k >> r)
 *         k *= m
 */
    __pyx_v_k = (__pyx_v_k * __pyx_v_m);

    /* "sweepea.pyx":717
 *         # mmix(h, k).
 *         k *= m
 *         k = k ^ (k >> r)             # <<<<<<<<<<<<<<
 *         k *= m
 *         h *= m
 */
    __pyx_v_k = (__pyx_v_k ^ (__pyx_v_k >> __pyx_v_r));

    /* "sweepea.pyx":718
 *         k *= m
 *         k = k ^ (k >> r)
 *         k *= m             # <<<<<<<<<<<<<<
 *         h *= m
 *         h = h ^ k
 */
    __pyx_v_k = (__pyx_v_k * __pyx_v_m);

    /* "sweepea.pyx":719
 *         k = k ^ (k >> r)
 *         k *= m
 *         h *= m             # <<<<<<<<<<<<<<
 *         h = h ^ k
 * 
 */
    __pyx_v_h = (__pyx_v_h * __pyx_v_m);

    /* "sweepea.pyx":720
 *         k *= m
 *         h *= m
 *         h = h ^ k             # <<<<<<<<<<<<<<
 * 
 *         data += 4
 */
    __pyx_v_h = (__pyx_v_h ^ __pyx_v_k);

    /* "sweepea.pyx":722
 *         h = h ^ k
 * 
 *         data += 4             # <<<<<<<<<<<<<<
 *         nlen -= 4
 * 
 */
    __pyx_v_data = (__pyx_v_data + 4);

    /* "sweepea.pyx":723
 * 
 *         data += 4
 *         nlen -= 4             # <<<<<<<<<<<<<<
 * 
 *     if nlen == 3:
 */
    __pyx_v_nlen = (__pyx_v_nlen - 4);
  }

  /* "sweepea.pyx":725
 *         nlen -= 4
 * 
 *     if nlen == 3:             # <<<<<<<<<<<<<<
 *         t = t ^ (data[2] << 16)
 *     if nlen >= 2:
 */
  __pyx_t_1 = ((__pyx_v_nlen == 3) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":726
 * 
 *     if nlen == 3:
 *         t = t ^ (data[2] << 16)             # <<<<<<<<<<<<<<
 *     if nlen >= 2:
 *         t = t ^ (data[1] << 8)
 */
    __pyx_v_t = (__pyx_v_t ^ ((__pyx_v_data[2]) << 16));

    /* "sweepea.pyx":725
 *         nlen -= 4
 * 
 *     if nlen == 3:             # <<<<<<<<<<<<<<
 *         t = t ^ (data[2] << 16)
 *     if nlen >= 2:
 */
  }

  /* "sweepea.pyx":727
 *     if nlen == 3:
 *         t = t ^ (data[2] << 16)
 *     if nlen >= 2:             # <<<<<<<<<<<<<<
 *         t = t ^ (data[1] << 8)
 *     if nlen >= 1:
 */
  __pyx_t_1 = ((__pyx_v_nlen >= 2) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":728
 *         t = t ^ (data[2] << 16)
 *     if nlen >= 2:
 *         t = t ^ (data[1] << 8)             # <<<<<<<<<<<<<<
 *     if nlen >= 1:
 *         t = t ^ (data[0])
 */
    __pyx_v_t = (__pyx_v_t ^ ((__pyx_v_data[1]) << 8));

    /* "sweepea.pyx":727
 *     if nlen == 3:
 *         t = t ^ (data[2] << 16)
 *     if nlen >= 2:             # <<<<<<<<<<<<<<
 *         t = t ^ (data[1] << 8)
 *     if nlen >= 1:
 */
  }

  /* "sweepea.pyx":729
 *     if nlen >= 2:
 *         t = t ^ (data[1] << 8)
 *     if nlen >= 1:             # <<<<<<<<<<<<<<
 *         t = t ^ (data[0])
 * 
 */
  __pyx_t_1 = ((__pyx_v_nlen >= 1) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":730
 *         t = t ^ (data[1] << 8)
 *     if nlen >= 1:
 *         t = t ^ (data[0])             # <<<<<<<<<<<<<<
 * 
 *     # mmix(h, t).
 */
    __pyx_v_t = (__pyx_v_t ^ (__pyx_v_data[0]));

    /* "sweepea.pyx":729
 *     if nlen >= 2:
 *         t = t ^ (data[1] << 8)
 *     if nlen >= 1:             # <<<<<<<<<<<<<<
 *         t = t ^ (data[0])
 * 
 */
  }

  /* "sweepea.pyx":733
 * 
 *     # mmix(h, t).
 *     t *= m             # <<<<<<<<<<<<<<
 *     t = t ^ (t >> r)
 *     t *= m
 */
  __pyx_v_t = (__pyx_v_t * __pyx_v_m);

  /* "sweepea.pyx":734
 *     # mmix(h, t).
 *     t *= m
 *     t = t ^ (t >> r)             # <<<<<<<<<<<<<<
 *     t *= m
 *     h *= m
 */
  __pyx_v_t = (__pyx_v_t ^ (__pyx_v_t >> __pyx_v_r));

  /* "sweepea.pyx":735
 *     t *= m
 *     t = t ^ (t >> r)
 *     t *= m             # <<<<<<<<<<<<<<
 *     h *= m
 *     h = h ^ t
 */
  __pyx_v_t = (__pyx_v_t * __pyx_v_m);

  /* "sweepea.pyx":736
 *     t = t ^ (t >> r)
 *     t *= m
 *     h *= m             # <<<<<<<<<<<<<<
 *     h = h ^ t
 * 
 */
  __pyx_v_h = (__pyx_v_h * __pyx_v_m);

  /* "sweepea.pyx":737
 *     t *= m
 *     h *= m
 *     h = h ^ t             # <<<<<<<<<<<<<<
 * 
 *     # mmix(h, l).
 */
  __pyx_v_h = (__pyx_v_h ^ __pyx_v_t);

  /* "sweepea.pyx":740
 * 
 *     # mmix(h, l).
 *     l *= m             # <<<<<<<<<<<<<<
 *     l = l ^ (l >> r)
 *     l *= m
 */
  __pyx_v_l = (__pyx_v_l * __pyx_v_m);

  /* "sweepea.pyx":741
 *     # mmix(h, l).
 *     l *= m
 *     l = l ^ (l >> r)             # <<<<<<<<<<<<<<
 *     l *= m
 *     h *= m
 */
  __pyx_v_l = (__pyx_v_l ^ (__pyx_v_l >> __pyx_v_r));

  /* "sweepea.pyx":742
 *     l *= m
 *     l = l ^ (l >> r)
 *     l *= m             # <<<<<<<<<<<<<<
 *     h *= m
 *     h = h ^ l
 */
  __pyx_v_l = (__pyx_v_l * __pyx_v_m);

  /* "sweepea.pyx":743
 *     l = l ^ (l >> r)
 *     l *= m
 *     h *= m             # <<<<<<<<<<<<<<
 *     h = h ^ l
 * 
 */
  __pyx_v_h = (__pyx_v_h * __pyx_v_m);

  /* "sweepea.pyx":744
 *     l *= m
 *     h *= m
 *     h = h ^ l             # <<<<<<<<<<<<<<
 * 
 *     h = h ^ (h >> 13)
 */
  __pyx_v_h = (__pyx_v_h ^ __pyx_v_l);

  /* "sweepea.pyx":746
 *     h = h ^ l
 * 
 *     h = h ^ (h >> 13)             # <<<<<<<<<<<<<<
 *     h *= m
 *     h = h ^ (h >> 15)
 */
  __pyx_v_h = (__pyx_v_h ^ (__pyx_v_h >> 13));

  /* "sweepea.pyx":747
 * 
 *     h = h ^ (h >> 13)
 *     h *= m             # <<<<<<<<<<<<<<
 *     h = h ^ (h >> 15)
 * 
 */
  __pyx_v_h = (__pyx_v_h * __pyx_v_m);

  /* "sweepea.pyx":748
 *     h = h ^ (h >> 13)
 *     h *= m
 *     h = h ^ (h >> 15)             # <<<<<<<<<<<<<<
 * 
 *     return h
 */
  __pyx_v_h = (__pyx_v_h ^ (__pyx_v_h >> 15));

  /* "sweepea.pyx":750
 *     h = h ^ (h >> 15)
 * 
 *     return h             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_h;
  goto __pyx_L0;

  /* "sweepea.pyx":702
 * 
 * 
 * cdef unsigned int murmurhash2(const char *key, int nlen, unsigned int seed):             # <<<<<<<<<<<<<<
 *     cdef:
 *         unsigned int m = 0x5bd1e995
 */

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

/* "sweepea.pyx":753
 * 
 * 
 * def murmurhash(key, seed=None):             # <<<<<<<<<<<<<<
 *     if key is None:
 *         return
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_1murmurhash(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_1murmurhash = {"murmurhash", (PyCFunction)__pyx_pw_7sweepea_1murmurhash, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_1murmurhash(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_seed = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("murmurhash (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_seed,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_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seed);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "murmurhash") < 0)) __PYX_ERR(0, 753, __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_key = values[0];
    __pyx_v_seed = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("murmurhash", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 753, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.murmurhash", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_murmurhash(__pyx_self, __pyx_v_key, __pyx_v_seed);

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

static PyObject *__pyx_pf_7sweepea_murmurhash(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_key, PyObject *__pyx_v_seed) {
  PyObject *__pyx_v_bkey = 0;
  int __pyx_v_nseed;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("murmurhash", 0);

  /* "sweepea.pyx":754
 * 
 * def murmurhash(key, seed=None):
 *     if key is None:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  __pyx_t_1 = (__pyx_v_key == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":755
 * def murmurhash(key, seed=None):
 *     if key is None:
 *         return             # <<<<<<<<<<<<<<
 * 
 *     cdef:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "sweepea.pyx":754
 * 
 * def murmurhash(key, seed=None):
 *     if key is None:             # <<<<<<<<<<<<<<
 *         return
 * 
 */
  }

  /* "sweepea.pyx":759
 *     cdef:
 *         bytes bkey
 *         int nseed = seed or 0             # <<<<<<<<<<<<<<
 * 
 *     if isinstance(key, unicode):
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_seed); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 759, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_seed); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 759, __pyx_L1_error)
    __pyx_t_3 = __pyx_t_4;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = 0;
  __pyx_L4_bool_binop_done:;
  __pyx_v_nseed = __pyx_t_3;

  /* "sweepea.pyx":761
 *         int nseed = seed or 0
 * 
 *     if isinstance(key, unicode):             # <<<<<<<<<<<<<<
 *         bkey = <bytes>key.encode('utf-8')
 *     else:
 */
  __pyx_t_2 = PyUnicode_Check(__pyx_v_key); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":762
 * 
 *     if isinstance(key, unicode):
 *         bkey = <bytes>key.encode('utf-8')             # <<<<<<<<<<<<<<
 *     else:
 *         bkey = <bytes>key
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 762, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 762, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __pyx_t_6;
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_bkey = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;

    /* "sweepea.pyx":761
 *         int nseed = seed or 0
 * 
 *     if isinstance(key, unicode):             # <<<<<<<<<<<<<<
 *         bkey = <bytes>key.encode('utf-8')
 *     else:
 */
    goto __pyx_L6;
  }

  /* "sweepea.pyx":764
 *         bkey = <bytes>key.encode('utf-8')
 *     else:
 *         bkey = <bytes>key             # <<<<<<<<<<<<<<
 * 
 *     if key:
 */
  /*else*/ {
    __pyx_t_5 = __pyx_v_key;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_v_bkey = ((PyObject*)__pyx_t_5);
    __pyx_t_5 = 0;
  }
  __pyx_L6:;

  /* "sweepea.pyx":766
 *         bkey = <bytes>key
 * 
 *     if key:             # <<<<<<<<<<<<<<
 *         return murmurhash2(<char *>bkey, len(bkey), nseed)
 *     return 0
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_key); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 766, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "sweepea.pyx":767
 * 
 *     if key:
 *         return murmurhash2(<char *>bkey, len(bkey), nseed)             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyObject_AsString(__pyx_v_bkey); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(0, 767, __pyx_L1_error)
    if (unlikely(__pyx_v_bkey == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
      __PYX_ERR(0, 767, __pyx_L1_error)
    }
    __pyx_t_8 = PyBytes_GET_SIZE(__pyx_v_bkey); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 767, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_f_7sweepea_murmurhash2(((char *)__pyx_t_7), __pyx_t_8, __pyx_v_nseed)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "sweepea.pyx":766
 *         bkey = <bytes>key
 * 
 *     if key:             # <<<<<<<<<<<<<<
 *         return murmurhash2(<char *>bkey, len(bkey), nseed)
 *     return 0
 */
  }

  /* "sweepea.pyx":768
 *     if key:
 *         return murmurhash2(<char *>bkey, len(bkey), nseed)
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_int_0);
  __pyx_r = __pyx_int_0;
  goto __pyx_L0;

  /* "sweepea.pyx":753
 * 
 * 
 * def murmurhash(key, seed=None):             # <<<<<<<<<<<<<<
 *     if key is None:
 *         return
 */

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

/* "sweepea.pyx":771
 * 
 * 
 * cdef bint regexp(basestring value, basestring regex):             # <<<<<<<<<<<<<<
 *     # Expose regular expression matching in SQLite.
 *     return re.search(regex, value, re.I) is not None
 */

static int __pyx_f_7sweepea_regexp(PyObject *__pyx_v_value, PyObject *__pyx_v_regex) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("regexp", 0);

  /* "sweepea.pyx":773
 * cdef bint regexp(basestring value, basestring regex):
 *     # Expose regular expression matching in SQLite.
 *     return re.search(regex, value, re.I) is not None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_search); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 773, __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_re); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_I_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_v_regex);
  __Pyx_GIVEREF(__pyx_v_regex);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_regex);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_7;
  goto __pyx_L0;

  /* "sweepea.pyx":771
 * 
 * 
 * cdef bint regexp(basestring value, basestring regex):             # <<<<<<<<<<<<<<
 *     # Expose regular expression matching in SQLite.
 *     return re.search(regex, value, re.I) is not None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("sweepea.regexp", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":776
 * 
 * 
 * def make_hash(hash_impl):             # <<<<<<<<<<<<<<
 *     def inner(*items):
 *         state = hash_impl()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_3make_hash(PyObject *__pyx_self, PyObject *__pyx_v_hash_impl); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_3make_hash = {"make_hash", (PyCFunction)__pyx_pw_7sweepea_3make_hash, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_3make_hash(PyObject *__pyx_self, PyObject *__pyx_v_hash_impl) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("make_hash (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_2make_hash(__pyx_self, ((PyObject *)__pyx_v_hash_impl));

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

/* "sweepea.pyx":777
 * 
 * def make_hash(hash_impl):
 *     def inner(*items):             # <<<<<<<<<<<<<<
 *         state = hash_impl()
 *         for item in items:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_9make_hash_1inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_9make_hash_1inner = {"inner", (PyCFunction)__pyx_pw_7sweepea_9make_hash_1inner, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_9make_hash_1inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inner (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "inner", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_items = __pyx_args;
  __pyx_r = __pyx_pf_7sweepea_9make_hash_inner(__pyx_self, __pyx_v_items);

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

static PyObject *__pyx_pf_7sweepea_9make_hash_inner(PyObject *__pyx_self, PyObject *__pyx_v_items) {
  struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash *__pyx_cur_scope;
  struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash *__pyx_outer_scope;
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("inner", 0);
  __pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "sweepea.pyx":778
 * def make_hash(hash_impl):
 *     def inner(*items):
 *         state = hash_impl()             # <<<<<<<<<<<<<<
 *         for item in items:
 *             state.update(item)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_hash_impl)) { __Pyx_RaiseClosureNameError("hash_impl"); __PYX_ERR(0, 778, __pyx_L1_error) }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_hash_impl);
  __pyx_t_2 = __pyx_cur_scope->__pyx_v_hash_impl; __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 778, __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, 778, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":779
 *     def inner(*items):
 *         state = hash_impl()
 *         for item in items:             # <<<<<<<<<<<<<<
 *             state.update(item)
 *         return state.hexdigest()
 */
  __pyx_t_1 = __pyx_v_items; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
  for (;;) {
    if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 779, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "sweepea.pyx":780
 *         state = hash_impl()
 *         for item in items:
 *             state.update(item)             # <<<<<<<<<<<<<<
 *         return state.hexdigest()
 *     return inner
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_update); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 780, __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_item);
      __Pyx_GIVEREF(__pyx_v_item);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_item);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 780, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":779
 *     def inner(*items):
 *         state = hash_impl()
 *         for item in items:             # <<<<<<<<<<<<<<
 *             state.update(item)
 *         return state.hexdigest()
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":781
 *         for item in items:
 *             state.update(item)
 *         return state.hexdigest()             # <<<<<<<<<<<<<<
 *     return inner
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_hexdigest); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 781, __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, 781, __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;

  /* "sweepea.pyx":777
 * 
 * def make_hash(hash_impl):
 *     def inner(*items):             # <<<<<<<<<<<<<<
 *         state = hash_impl()
 *         for item in items:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("sweepea.make_hash.inner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":776
 * 
 * 
 * def make_hash(hash_impl):             # <<<<<<<<<<<<<<
 *     def inner(*items):
 *         state = hash_impl()
 */

static PyObject *__pyx_pf_7sweepea_2make_hash(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_hash_impl) {
  struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash *__pyx_cur_scope;
  PyObject *__pyx_v_inner = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("make_hash", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash *)__pyx_tp_new_7sweepea___pyx_scope_struct__make_hash(__pyx_ptype_7sweepea___pyx_scope_struct__make_hash, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_hash_impl = __pyx_v_hash_impl;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_hash_impl);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_hash_impl);

  /* "sweepea.pyx":777
 * 
 * def make_hash(hash_impl):
 *     def inner(*items):             # <<<<<<<<<<<<<<
 *         state = hash_impl()
 *         for item in items:
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_9make_hash_1inner, 0, __pyx_n_s_make_hash_locals_inner, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_inner = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":782
 *             state.update(item)
 *         return state.hexdigest()
 *     return inner             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_inner);
  __pyx_r = __pyx_v_inner;
  goto __pyx_L0;

  /* "sweepea.pyx":776
 * 
 * 
 * def make_hash(hash_impl):             # <<<<<<<<<<<<<<
 *     def inner(*items):
 *         state = hash_impl()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.make_hash", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inner);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":790
 * 
 * 
 * cdef int _aggressive_busy_handler(void *ptr, int n):             # <<<<<<<<<<<<<<
 *     # In concurrent environments, it often seems that if multiple queries are
 *     # kicked off at around the same time, they proceed in lock-step to check
 */

static int __pyx_f_7sweepea__aggressive_busy_handler(void *__pyx_v_ptr, int __pyx_v_n) {
  int __pyx_v_busyTimeout;
  int __pyx_v_current;
  int __pyx_v_total;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_aggressive_busy_handler", 0);

  /* "sweepea.pyx":797
 *     # attempts in the same time period than the default handler.
 *     cdef:
 *         int busyTimeout = <int>ptr             # <<<<<<<<<<<<<<
 *         int current, total
 * 
 */
  __pyx_v_busyTimeout = ((int)__pyx_v_ptr);

  /* "sweepea.pyx":800
 *         int current, total
 * 
 *     if n < 20:             # <<<<<<<<<<<<<<
 *         current = 25 - (rand() % 10)  # ~20ms
 *         total = n * 20
 */
  __pyx_t_1 = ((__pyx_v_n < 20) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":801
 * 
 *     if n < 20:
 *         current = 25 - (rand() % 10)  # ~20ms             # <<<<<<<<<<<<<<
 *         total = n * 20
 *     elif n < 40:
 */
    __pyx_v_current = (25 - __Pyx_mod_long(rand(), 10));

    /* "sweepea.pyx":802
 *     if n < 20:
 *         current = 25 - (rand() % 10)  # ~20ms
 *         total = n * 20             # <<<<<<<<<<<<<<
 *     elif n < 40:
 *         current = 50 - (rand() % 20)  # ~40ms
 */
    __pyx_v_total = (__pyx_v_n * 20);

    /* "sweepea.pyx":800
 *         int current, total
 * 
 *     if n < 20:             # <<<<<<<<<<<<<<
 *         current = 25 - (rand() % 10)  # ~20ms
 *         total = n * 20
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":803
 *         current = 25 - (rand() % 10)  # ~20ms
 *         total = n * 20
 *     elif n < 40:             # <<<<<<<<<<<<<<
 *         current = 50 - (rand() % 20)  # ~40ms
 *         total = 400 + ((n - 20) * 40)
 */
  __pyx_t_1 = ((__pyx_v_n < 40) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":804
 *         total = n * 20
 *     elif n < 40:
 *         current = 50 - (rand() % 20)  # ~40ms             # <<<<<<<<<<<<<<
 *         total = 400 + ((n - 20) * 40)
 *     else:
 */
    __pyx_v_current = (50 - __Pyx_mod_long(rand(), 20));

    /* "sweepea.pyx":805
 *     elif n < 40:
 *         current = 50 - (rand() % 20)  # ~40ms
 *         total = 400 + ((n - 20) * 40)             # <<<<<<<<<<<<<<
 *     else:
 *         current = 120 - (rand() % 40)  # ~100ms
 */
    __pyx_v_total = (0x190 + ((__pyx_v_n - 20) * 40));

    /* "sweepea.pyx":803
 *         current = 25 - (rand() % 10)  # ~20ms
 *         total = n * 20
 *     elif n < 40:             # <<<<<<<<<<<<<<
 *         current = 50 - (rand() % 20)  # ~40ms
 *         total = 400 + ((n - 20) * 40)
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":807
 *         total = 400 + ((n - 20) * 40)
 *     else:
 *         current = 120 - (rand() % 40)  # ~100ms             # <<<<<<<<<<<<<<
 *         total = 1200 + ((n - 40) * 100)  # Estimate the amount of time slept.
 * 
 */
  /*else*/ {
    __pyx_v_current = (0x78 - __Pyx_mod_long(rand(), 40));

    /* "sweepea.pyx":808
 *     else:
 *         current = 120 - (rand() % 40)  # ~100ms
 *         total = 1200 + ((n - 40) * 100)  # Estimate the amount of time slept.             # <<<<<<<<<<<<<<
 * 
 *     if total + current > busyTimeout:
 */
    __pyx_v_total = (0x4B0 + ((__pyx_v_n - 40) * 0x64));
  }
  __pyx_L3:;

  /* "sweepea.pyx":810
 *         total = 1200 + ((n - 40) * 100)  # Estimate the amount of time slept.
 * 
 *     if total + current > busyTimeout:             # <<<<<<<<<<<<<<
 *         current = busyTimeout - total
 *     if current > 0:
 */
  __pyx_t_1 = (((__pyx_v_total + __pyx_v_current) > __pyx_v_busyTimeout) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":811
 * 
 *     if total + current > busyTimeout:
 *         current = busyTimeout - total             # <<<<<<<<<<<<<<
 *     if current > 0:
 *         sqlite3_sleep(current)
 */
    __pyx_v_current = (__pyx_v_busyTimeout - __pyx_v_total);

    /* "sweepea.pyx":810
 *         total = 1200 + ((n - 40) * 100)  # Estimate the amount of time slept.
 * 
 *     if total + current > busyTimeout:             # <<<<<<<<<<<<<<
 *         current = busyTimeout - total
 *     if current > 0:
 */
  }

  /* "sweepea.pyx":812
 *     if total + current > busyTimeout:
 *         current = busyTimeout - total
 *     if current > 0:             # <<<<<<<<<<<<<<
 *         sqlite3_sleep(current)
 *         return 1
 */
  __pyx_t_1 = ((__pyx_v_current > 0) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":813
 *         current = busyTimeout - total
 *     if current > 0:
 *         sqlite3_sleep(current)             # <<<<<<<<<<<<<<
 *         return 1
 *     return 0
 */
    sqlite3_sleep(__pyx_v_current);

    /* "sweepea.pyx":814
 *     if current > 0:
 *         sqlite3_sleep(current)
 *         return 1             # <<<<<<<<<<<<<<
 *     return 0
 * 
 */
    __pyx_r = 1;
    goto __pyx_L0;

    /* "sweepea.pyx":812
 *     if total + current > busyTimeout:
 *         current = busyTimeout - total
 *     if current > 0:             # <<<<<<<<<<<<<<
 *         sqlite3_sleep(current)
 *         return 1
 */
  }

  /* "sweepea.pyx":815
 *         sqlite3_sleep(current)
 *         return 1
 *     return 0             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":790
 * 
 * 
 * cdef int _aggressive_busy_handler(void *ptr, int n):             # <<<<<<<<<<<<<<
 *     # In concurrent environments, it often seems that if multiple queries are
 *     # kicked off at around the same time, they proceed in lock-step to check
 */

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

/* "sweepea.pyx":827
 *         CursorWrapper cursor_wrapper
 * 
 *     def __init__(self, CursorWrapper cursor_wrapper):             # <<<<<<<<<<<<<<
 *         self.cursor_wrapper = cursor_wrapper
 *         self.index = 0
 */

/* Python wrapper */
static int __pyx_pw_7sweepea_14ResultIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7sweepea_14ResultIterator_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_cursor_wrapper = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cursor_wrapper,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) {
        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_cursor_wrapper)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 827, __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_cursor_wrapper = ((struct __pyx_obj_7sweepea_CursorWrapper *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 827, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.ResultIterator.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cursor_wrapper), __pyx_ptype_7sweepea_CursorWrapper, 1, "cursor_wrapper", 0))) __PYX_ERR(0, 827, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_14ResultIterator___init__(((struct __pyx_obj_7sweepea_ResultIterator *)__pyx_v_self), __pyx_v_cursor_wrapper);

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

static int __pyx_pf_7sweepea_14ResultIterator___init__(struct __pyx_obj_7sweepea_ResultIterator *__pyx_v_self, struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_cursor_wrapper) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":828
 * 
 *     def __init__(self, CursorWrapper cursor_wrapper):
 *         self.cursor_wrapper = cursor_wrapper             # <<<<<<<<<<<<<<
 *         self.index = 0
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_cursor_wrapper));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_cursor_wrapper));
  __Pyx_GOTREF(__pyx_v_self->cursor_wrapper);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->cursor_wrapper));
  __pyx_v_self->cursor_wrapper = __pyx_v_cursor_wrapper;

  /* "sweepea.pyx":829
 *     def __init__(self, CursorWrapper cursor_wrapper):
 *         self.cursor_wrapper = cursor_wrapper
 *         self.index = 0             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __pyx_v_self->index = 0;

  /* "sweepea.pyx":827
 *         CursorWrapper cursor_wrapper
 * 
 *     def __init__(self, CursorWrapper cursor_wrapper):             # <<<<<<<<<<<<<<
 *         self.cursor_wrapper = cursor_wrapper
 *         self.index = 0
 */

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

/* "sweepea.pyx":831
 *         self.index = 0
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef CursorWrapper cw = self.cursor_wrapper
 *         if self.index < cw.count:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_14ResultIterator_3__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_14ResultIterator_3__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_14ResultIterator_2__next__(((struct __pyx_obj_7sweepea_ResultIterator *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_14ResultIterator_2__next__(struct __pyx_obj_7sweepea_ResultIterator *__pyx_v_self) {
  struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_cw = 0;
  PyObject *__pyx_v_obj = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "sweepea.pyx":832
 * 
 *     def __next__(self):
 *         cdef CursorWrapper cw = self.cursor_wrapper             # <<<<<<<<<<<<<<
 *         if self.index < cw.count:
 *             obj = cw.result_cache[self.index]
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->cursor_wrapper);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_cw = ((struct __pyx_obj_7sweepea_CursorWrapper *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":833
 *     def __next__(self):
 *         cdef CursorWrapper cw = self.cursor_wrapper
 *         if self.index < cw.count:             # <<<<<<<<<<<<<<
 *             obj = cw.result_cache[self.index]
 *         elif not cw.is_populated:
 */
  __pyx_t_2 = ((__pyx_v_self->index < __pyx_v_cw->count) != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":834
 *         cdef CursorWrapper cw = self.cursor_wrapper
 *         if self.index < cw.count:
 *             obj = cw.result_cache[self.index]             # <<<<<<<<<<<<<<
 *         elif not cw.is_populated:
 *             obj = cw.iterate()
 */
    if (unlikely(__pyx_v_cw->result_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 834, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_GetItemInt_List(__pyx_v_cw->result_cache, __pyx_v_self->index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_obj = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "sweepea.pyx":833
 *     def __next__(self):
 *         cdef CursorWrapper cw = self.cursor_wrapper
 *         if self.index < cw.count:             # <<<<<<<<<<<<<<
 *             obj = cw.result_cache[self.index]
 *         elif not cw.is_populated:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":835
 *         if self.index < cw.count:
 *             obj = cw.result_cache[self.index]
 *         elif not cw.is_populated:             # <<<<<<<<<<<<<<
 *             obj = cw.iterate()
 *             cw.result_cache.append(obj)
 */
  __pyx_t_2 = ((!(__pyx_v_cw->is_populated != 0)) != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":836
 *             obj = cw.result_cache[self.index]
 *         elif not cw.is_populated:
 *             obj = cw.iterate()             # <<<<<<<<<<<<<<
 *             cw.result_cache.append(obj)
 *             cw.count += 1
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_CursorWrapper *)__pyx_v_cw->__pyx_vtab)->iterate(__pyx_v_cw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_obj = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "sweepea.pyx":837
 *         elif not cw.is_populated:
 *             obj = cw.iterate()
 *             cw.result_cache.append(obj)             # <<<<<<<<<<<<<<
 *             cw.count += 1
 *         else:
 */
    if (unlikely(__pyx_v_cw->result_cache == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
      __PYX_ERR(0, 837, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_cw->result_cache, __pyx_v_obj); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 837, __pyx_L1_error)

    /* "sweepea.pyx":838
 *             obj = cw.iterate()
 *             cw.result_cache.append(obj)
 *             cw.count += 1             # <<<<<<<<<<<<<<
 *         else:
 *             raise StopIteration
 */
    __pyx_v_cw->count = (__pyx_v_cw->count + 1);

    /* "sweepea.pyx":835
 *         if self.index < cw.count:
 *             obj = cw.result_cache[self.index]
 *         elif not cw.is_populated:             # <<<<<<<<<<<<<<
 *             obj = cw.iterate()
 *             cw.result_cache.append(obj)
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":840
 *             cw.count += 1
 *         else:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         self.index += 1
 *         return obj
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 840, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "sweepea.pyx":841
 *         else:
 *             raise StopIteration
 *         self.index += 1             # <<<<<<<<<<<<<<
 *         return obj
 * 
 */
  __pyx_v_self->index = (__pyx_v_self->index + 1);

  /* "sweepea.pyx":842
 *             raise StopIteration
 *         self.index += 1
 *         return obj             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  /* "sweepea.pyx":831
 *         self.index = 0
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef CursorWrapper cw = self.cursor_wrapper
 *         if self.index < cw.count:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.ResultIterator.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_cw);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":852
 *         object cursor, transform
 * 
 *     def __init__(self, cursor, transform=None):             # <<<<<<<<<<<<<<
 *         self.cursor = cursor
 *         self.transform = transform
 */

/* Python wrapper */
static int __pyx_pw_7sweepea_13CursorWrapper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7sweepea_13CursorWrapper_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_cursor = 0;
  PyObject *__pyx_v_transform = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cursor,&__pyx_n_s_transform,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_cursor)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transform);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 852, __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_cursor = values[0];
    __pyx_v_transform = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 852, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.CursorWrapper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_13CursorWrapper___init__(((struct __pyx_obj_7sweepea_CursorWrapper *)__pyx_v_self), __pyx_v_cursor, __pyx_v_transform);

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

static int __pyx_pf_7sweepea_13CursorWrapper___init__(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self, PyObject *__pyx_v_cursor, PyObject *__pyx_v_transform) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":853
 * 
 *     def __init__(self, cursor, transform=None):
 *         self.cursor = cursor             # <<<<<<<<<<<<<<
 *         self.transform = transform
 *         self.is_initialized = False
 */
  __Pyx_INCREF(__pyx_v_cursor);
  __Pyx_GIVEREF(__pyx_v_cursor);
  __Pyx_GOTREF(__pyx_v_self->cursor);
  __Pyx_DECREF(__pyx_v_self->cursor);
  __pyx_v_self->cursor = __pyx_v_cursor;

  /* "sweepea.pyx":854
 *     def __init__(self, cursor, transform=None):
 *         self.cursor = cursor
 *         self.transform = transform             # <<<<<<<<<<<<<<
 *         self.is_initialized = False
 *         self.is_populated = False
 */
  __Pyx_INCREF(__pyx_v_transform);
  __Pyx_GIVEREF(__pyx_v_transform);
  __Pyx_GOTREF(__pyx_v_self->transform);
  __Pyx_DECREF(__pyx_v_self->transform);
  __pyx_v_self->transform = __pyx_v_transform;

  /* "sweepea.pyx":855
 *         self.cursor = cursor
 *         self.transform = transform
 *         self.is_initialized = False             # <<<<<<<<<<<<<<
 *         self.is_populated = False
 *         self.result_cache = []
 */
  __pyx_v_self->is_initialized = 0;

  /* "sweepea.pyx":856
 *         self.transform = transform
 *         self.is_initialized = False
 *         self.is_populated = False             # <<<<<<<<<<<<<<
 *         self.result_cache = []
 * 
 */
  __pyx_v_self->is_populated = 0;

  /* "sweepea.pyx":857
 *         self.is_initialized = False
 *         self.is_populated = False
 *         self.result_cache = []             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->result_cache);
  __Pyx_DECREF(__pyx_v_self->result_cache);
  __pyx_v_self->result_cache = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":852
 *         object cursor, transform
 * 
 *     def __init__(self, cursor, transform=None):             # <<<<<<<<<<<<<<
 *         self.cursor = cursor
 *         self.transform = transform
 */

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

/* "sweepea.pyx":859
 *         self.result_cache = []
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         if self.is_populated:
 *             return iter(self.result_cache)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_13CursorWrapper_3__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_13CursorWrapper_3__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_13CursorWrapper_2__iter__(((struct __pyx_obj_7sweepea_CursorWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_13CursorWrapper_2__iter__(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "sweepea.pyx":860
 * 
 *     def __iter__(self):
 *         if self.is_populated:             # <<<<<<<<<<<<<<
 *             return iter(self.result_cache)
 *         return ResultIterator(self)
 */
  __pyx_t_1 = (__pyx_v_self->is_populated != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":861
 *     def __iter__(self):
 *         if self.is_populated:
 *             return iter(self.result_cache)             # <<<<<<<<<<<<<<
 *         return ResultIterator(self)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_v_self->result_cache;
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "sweepea.pyx":860
 * 
 *     def __iter__(self):
 *         if self.is_populated:             # <<<<<<<<<<<<<<
 *             return iter(self.result_cache)
 *         return ResultIterator(self)
 */
  }

  /* "sweepea.pyx":862
 *         if self.is_populated:
 *             return iter(self.result_cache)
 *         return ResultIterator(self)             # <<<<<<<<<<<<<<
 * 
 *     def __len__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea_ResultIterator), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":859
 *         self.result_cache = []
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         if self.is_populated:
 *             return iter(self.result_cache)
 */

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

/* "sweepea.pyx":864
 *         return ResultIterator(self)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         self.fill_cache()
 *         return self.count
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_7sweepea_13CursorWrapper_5__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_7sweepea_13CursorWrapper_5__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_13CursorWrapper_4__len__(((struct __pyx_obj_7sweepea_CursorWrapper *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_7sweepea_13CursorWrapper_4__len__(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "sweepea.pyx":865
 * 
 *     def __len__(self):
 *         self.fill_cache()             # <<<<<<<<<<<<<<
 *         return self.count
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_CursorWrapper *)__pyx_v_self->__pyx_vtab)->fill_cache(__pyx_v_self, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":866
 *     def __len__(self):
 *         self.fill_cache()
 *         return self.count             # <<<<<<<<<<<<<<
 * 
 *     cdef initialize(self):
 */
  __pyx_r = __pyx_v_self->count;
  goto __pyx_L0;

  /* "sweepea.pyx":864
 *         return ResultIterator(self)
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         self.fill_cache()
 *         return self.count
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.CursorWrapper.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":868
 *         return self.count
 * 
 *     cdef initialize(self):             # <<<<<<<<<<<<<<
 *         self.columns = [col[0] for col in self.cursor.description]
 *         self.count = self.index = 0
 */

static PyObject *__pyx_f_7sweepea_13CursorWrapper_initialize(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self) {
  PyObject *__pyx_v_col = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  __Pyx_RefNannySetupContext("initialize", 0);

  /* "sweepea.pyx":869
 * 
 *     cdef initialize(self):
 *         self.columns = [col[0] for col in self.cursor.description]             # <<<<<<<<<<<<<<
 *         self.count = self.index = 0
 *         self.is_initialized = True
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->cursor, __pyx_n_s_description); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 869, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 869, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 869, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 869, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_col, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_col, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 869, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->columns);
  __Pyx_DECREF(__pyx_v_self->columns);
  __pyx_v_self->columns = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":870
 *     cdef initialize(self):
 *         self.columns = [col[0] for col in self.cursor.description]
 *         self.count = self.index = 0             # <<<<<<<<<<<<<<
 *         self.is_initialized = True
 * 
 */
  __pyx_v_self->count = 0;
  __pyx_v_self->index = 0;

  /* "sweepea.pyx":871
 *         self.columns = [col[0] for col in self.cursor.description]
 *         self.count = self.index = 0
 *         self.is_initialized = True             # <<<<<<<<<<<<<<
 * 
 *     cdef iterate(self):
 */
  __pyx_v_self->is_initialized = 1;

  /* "sweepea.pyx":868
 *         return self.count
 * 
 *     cdef initialize(self):             # <<<<<<<<<<<<<<
 *         self.columns = [col[0] for col in self.cursor.description]
 *         self.count = self.index = 0
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("sweepea.CursorWrapper.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_col);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":873
 *         self.is_initialized = True
 * 
 *     cdef iterate(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             tuple row = self.cursor.fetchone()
 */

static PyObject *__pyx_f_7sweepea_13CursorWrapper_iterate(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self) {
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("iterate", 0);

  /* "sweepea.pyx":875
 *     cdef iterate(self):
 *         cdef:
 *             tuple row = self.cursor.fetchone()             # <<<<<<<<<<<<<<
 * 
 *         if not row:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->cursor, __pyx_n_s_fetchone); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 875, __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, 875, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 875, __pyx_L1_error)
  __pyx_v_row = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":877
 *             tuple row = self.cursor.fetchone()
 * 
 *         if not row:             # <<<<<<<<<<<<<<
 *             self.is_populated = True
 *             raise StopIteration
 */
  __pyx_t_4 = (__pyx_v_row != Py_None) && (PyTuple_GET_SIZE(__pyx_v_row) != 0);
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "sweepea.pyx":878
 * 
 *         if not row:
 *             self.is_populated = True             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         elif not self.is_initialized:
 */
    __pyx_v_self->is_populated = 1;

    /* "sweepea.pyx":879
 *         if not row:
 *             self.is_populated = True
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         elif not self.is_initialized:
 *             self.initialize()
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 879, __pyx_L1_error)

    /* "sweepea.pyx":877
 *             tuple row = self.cursor.fetchone()
 * 
 *         if not row:             # <<<<<<<<<<<<<<
 *             self.is_populated = True
 *             raise StopIteration
 */
  }

  /* "sweepea.pyx":880
 *             self.is_populated = True
 *             raise StopIteration
 *         elif not self.is_initialized:             # <<<<<<<<<<<<<<
 *             self.initialize()
 * 
 */
  __pyx_t_5 = ((!(__pyx_v_self->is_initialized != 0)) != 0);
  if (__pyx_t_5) {

    /* "sweepea.pyx":881
 *             raise StopIteration
 *         elif not self.is_initialized:
 *             self.initialize()             # <<<<<<<<<<<<<<
 * 
 *         if self.transform is not None:
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_CursorWrapper *)__pyx_v_self->__pyx_vtab)->initialize(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":880
 *             self.is_populated = True
 *             raise StopIteration
 *         elif not self.is_initialized:             # <<<<<<<<<<<<<<
 *             self.initialize()
 * 
 */
  }

  /* "sweepea.pyx":883
 *             self.initialize()
 * 
 *         if self.transform is not None:             # <<<<<<<<<<<<<<
 *             return self.transform(self, row)
 *         else:
 */
  __pyx_t_5 = (__pyx_v_self->transform != Py_None);
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "sweepea.pyx":884
 * 
 *         if self.transform is not None:
 *             return self.transform(self, row)             # <<<<<<<<<<<<<<
 *         else:
 *             return row
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self->transform);
    __pyx_t_2 = __pyx_v_self->transform; __pyx_t_3 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 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_7, 0+__pyx_t_6, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_row);
    __Pyx_GIVEREF(__pyx_v_row);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_row);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "sweepea.pyx":883
 *             self.initialize()
 * 
 *         if self.transform is not None:             # <<<<<<<<<<<<<<
 *             return self.transform(self, row)
 *         else:
 */
  }

  /* "sweepea.pyx":886
 *             return self.transform(self, row)
 *         else:
 *             return row             # <<<<<<<<<<<<<<
 * 
 *     def iterator(self):
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_row);
    __pyx_r = __pyx_v_row;
    goto __pyx_L0;
  }

  /* "sweepea.pyx":873
 *         self.is_initialized = True
 * 
 *     cdef iterate(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             tuple row = self.cursor.fetchone()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("sweepea.CursorWrapper.iterate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7sweepea_13CursorWrapper_8generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "sweepea.pyx":888
 *             return row
 * 
 *     def iterator(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.iterate()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_13CursorWrapper_7iterator(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7sweepea_13CursorWrapper_7iterator(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iterator (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_13CursorWrapper_6iterator(((struct __pyx_obj_7sweepea_CursorWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_13CursorWrapper_6iterator(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iterator", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator *)__pyx_tp_new_7sweepea___pyx_scope_struct_1_iterator(__pyx_ptype_7sweepea___pyx_scope_struct_1_iterator, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7sweepea_13CursorWrapper_8generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_iterator, __pyx_n_s_CursorWrapper_iterator, __pyx_n_s_sweepea); if (unlikely(!gen)) __PYX_ERR(0, 888, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("sweepea.CursorWrapper.iterator", __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_7sweepea_13CursorWrapper_8generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator *__pyx_cur_scope = ((struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = 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, 888, __pyx_L1_error)

  /* "sweepea.pyx":889
 * 
 *     def iterator(self):
 *         while True:             # <<<<<<<<<<<<<<
 *             yield self.iterate()
 * 
 */
  while (1) {

    /* "sweepea.pyx":890
 *     def iterator(self):
 *         while True:
 *             yield self.iterate()             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_CursorWrapper *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->iterate(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 890, __pyx_L1_error)
  }

  /* "sweepea.pyx":888
 *             return row
 * 
 *     def iterator(self):             # <<<<<<<<<<<<<<
 *         while True:
 *             yield self.iterate()
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("iterator", __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;
}

/* "sweepea.pyx":892
 *             yield self.iterate()
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef object inst
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_13CursorWrapper_10__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_13CursorWrapper_10__next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_13CursorWrapper_9__next__(((struct __pyx_obj_7sweepea_CursorWrapper *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_13CursorWrapper_9__next__(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self) {
  PyObject *__pyx_v_inst = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "sweepea.pyx":895
 *         cdef object inst
 * 
 *         if self.index < self.count:             # <<<<<<<<<<<<<<
 *             inst = self.result_cache[self.index]
 *             self.index += 1
 */
  __pyx_t_1 = ((__pyx_v_self->index < __pyx_v_self->count) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":896
 * 
 *         if self.index < self.count:
 *             inst = self.result_cache[self.index]             # <<<<<<<<<<<<<<
 *             self.index += 1
 *             return inst
 */
    if (unlikely(__pyx_v_self->result_cache == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 896, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_GetItemInt_List(__pyx_v_self->result_cache, __pyx_v_self->index, int, 1, __Pyx_PyInt_From_int, 1, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 896, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_v_inst = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "sweepea.pyx":897
 *         if self.index < self.count:
 *             inst = self.result_cache[self.index]
 *             self.index += 1             # <<<<<<<<<<<<<<
 *             return inst
 *         elif self.is_populated:
 */
    __pyx_v_self->index = (__pyx_v_self->index + 1);

    /* "sweepea.pyx":898
 *             inst = self.result_cache[self.index]
 *             self.index += 1
 *             return inst             # <<<<<<<<<<<<<<
 *         elif self.is_populated:
 *             raise StopIteration
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_inst);
    __pyx_r = __pyx_v_inst;
    goto __pyx_L0;

    /* "sweepea.pyx":895
 *         cdef object inst
 * 
 *         if self.index < self.count:             # <<<<<<<<<<<<<<
 *             inst = self.result_cache[self.index]
 *             self.index += 1
 */
  }

  /* "sweepea.pyx":899
 *             self.index += 1
 *             return inst
 *         elif self.is_populated:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  __pyx_t_1 = (__pyx_v_self->is_populated != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":900
 *             return inst
 *         elif self.is_populated:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 * 
 *         inst = self.iterate()
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 900, __pyx_L1_error)

    /* "sweepea.pyx":899
 *             self.index += 1
 *             return inst
 *         elif self.is_populated:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 * 
 */
  }

  /* "sweepea.pyx":902
 *             raise StopIteration
 * 
 *         inst = self.iterate()             # <<<<<<<<<<<<<<
 *         self.result_cache.append(inst)
 *         self.count += 1
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea_CursorWrapper *)__pyx_v_self->__pyx_vtab)->iterate(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_inst = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "sweepea.pyx":903
 * 
 *         inst = self.iterate()
 *         self.result_cache.append(inst)             # <<<<<<<<<<<<<<
 *         self.count += 1
 *         self.index += 1
 */
  if (unlikely(__pyx_v_self->result_cache == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
    __PYX_ERR(0, 903, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyList_Append(__pyx_v_self->result_cache, __pyx_v_inst); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 903, __pyx_L1_error)

  /* "sweepea.pyx":904
 *         inst = self.iterate()
 *         self.result_cache.append(inst)
 *         self.count += 1             # <<<<<<<<<<<<<<
 *         self.index += 1
 *         return inst
 */
  __pyx_v_self->count = (__pyx_v_self->count + 1);

  /* "sweepea.pyx":905
 *         self.result_cache.append(inst)
 *         self.count += 1
 *         self.index += 1             # <<<<<<<<<<<<<<
 *         return inst
 * 
 */
  __pyx_v_self->index = (__pyx_v_self->index + 1);

  /* "sweepea.pyx":906
 *         self.count += 1
 *         self.index += 1
 *         return inst             # <<<<<<<<<<<<<<
 * 
 *     cpdef fill_cache(self, n=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_inst);
  __pyx_r = __pyx_v_inst;
  goto __pyx_L0;

  /* "sweepea.pyx":892
 *             yield self.iterate()
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         cdef object inst
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("sweepea.CursorWrapper.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inst);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":908
 *         return inst
 * 
 *     cpdef fill_cache(self, n=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int counter = -1 if n is None else <int>n
 */

static PyObject *__pyx_pw_7sweepea_13CursorWrapper_12fill_cache(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7sweepea_13CursorWrapper_fill_cache(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_13CursorWrapper_fill_cache *__pyx_optional_args) {
  PyObject *__pyx_v_n = ((PyObject *)Py_None);
  int __pyx_v_counter;
  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;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("fill_cache", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_n = __pyx_optional_args->n;
    }
  }
  /* 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_fill_cache); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_13CursorWrapper_12fill_cache)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 908, __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_n);
        __Pyx_GIVEREF(__pyx_v_n);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_n);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 908, __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;
  }

  /* "sweepea.pyx":910
 *     cpdef fill_cache(self, n=None):
 *         cdef:
 *             int counter = -1 if n is None else <int>n             # <<<<<<<<<<<<<<
 *         if counter > 0:
 *             counter = counter - self.count
 */
  __pyx_t_7 = (__pyx_v_n == Py_None);
  if ((__pyx_t_7 != 0)) {
    __pyx_t_6 = -1;
  } else {
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_v_n); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 910, __pyx_L1_error)
    __pyx_t_6 = ((int)__pyx_t_8);
  }
  __pyx_v_counter = __pyx_t_6;

  /* "sweepea.pyx":911
 *         cdef:
 *             int counter = -1 if n is None else <int>n
 *         if counter > 0:             # <<<<<<<<<<<<<<
 *             counter = counter - self.count
 * 
 */
  __pyx_t_7 = ((__pyx_v_counter > 0) != 0);
  if (__pyx_t_7) {

    /* "sweepea.pyx":912
 *             int counter = -1 if n is None else <int>n
 *         if counter > 0:
 *             counter = counter - self.count             # <<<<<<<<<<<<<<
 * 
 *         self.index = self.count
 */
    __pyx_v_counter = (__pyx_v_counter - __pyx_v_self->count);

    /* "sweepea.pyx":911
 *         cdef:
 *             int counter = -1 if n is None else <int>n
 *         if counter > 0:             # <<<<<<<<<<<<<<
 *             counter = counter - self.count
 * 
 */
  }

  /* "sweepea.pyx":914
 *             counter = counter - self.count
 * 
 *         self.index = self.count             # <<<<<<<<<<<<<<
 *         while not self.is_populated and counter:
 *             try:
 */
  __pyx_t_6 = __pyx_v_self->count;
  __pyx_v_self->index = __pyx_t_6;

  /* "sweepea.pyx":915
 * 
 *         self.index = self.count
 *         while not self.is_populated and counter:             # <<<<<<<<<<<<<<
 *             try:
 *                 next(self)
 */
  while (1) {
    __pyx_t_9 = ((!(__pyx_v_self->is_populated != 0)) != 0);
    if (__pyx_t_9) {
    } else {
      __pyx_t_7 = __pyx_t_9;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_9 = (__pyx_v_counter != 0);
    __pyx_t_7 = __pyx_t_9;
    __pyx_L6_bool_binop_done:;
    if (!__pyx_t_7) break;

    /* "sweepea.pyx":916
 *         self.index = self.count
 *         while not self.is_populated and counter:
 *             try:             # <<<<<<<<<<<<<<
 *                 next(self)
 *             except StopIteration:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      /*try:*/ {

        /* "sweepea.pyx":917
 *         while not self.is_populated and counter:
 *             try:
 *                 next(self)             # <<<<<<<<<<<<<<
 *             except StopIteration:
 *                 break
 */
        __pyx_t_1 = __Pyx_PyIter_Next(((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L8_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "sweepea.pyx":916
 *         self.index = self.count
 *         while not self.is_populated and counter:
 *             try:             # <<<<<<<<<<<<<<
 *                 next(self)
 *             except StopIteration:
 */
      }

      /* "sweepea.pyx":921
 *                 break
 *             else:
 *                 counter -= 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
      /*else:*/ {
        __pyx_v_counter = (__pyx_v_counter - 1);
      }
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      goto __pyx_L15_try_end;
      __pyx_L8_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __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;

      /* "sweepea.pyx":918
 *             try:
 *                 next(self)
 *             except StopIteration:             # <<<<<<<<<<<<<<
 *                 break
 *             else:
 */
      __pyx_t_6 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
      if (__pyx_t_6) {
        __Pyx_AddTraceback("sweepea.CursorWrapper.fill_cache", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 918, __pyx_L10_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_3);

        /* "sweepea.pyx":919
 *                 next(self)
 *             except StopIteration:
 *                 break             # <<<<<<<<<<<<<<
 *             else:
 *                 counter -= 1
 */
        goto __pyx_L16_except_break;
        __pyx_L16_except_break:;
        __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;
        goto __pyx_L13_try_break;
      }
      goto __pyx_L10_except_error;
      __pyx_L10_except_error:;

      /* "sweepea.pyx":916
 *         self.index = self.count
 *         while not self.is_populated and counter:
 *             try:             # <<<<<<<<<<<<<<
 *                 next(self)
 *             except StopIteration:
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L1_error;
      __pyx_L13_try_break:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      goto __pyx_L5_break;
      __pyx_L15_try_end:;
    }
  }
  __pyx_L5_break:;

  /* "sweepea.pyx":908
 *         return inst
 * 
 *     cpdef fill_cache(self, n=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int counter = -1 if n is None else <int>n
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea.CursorWrapper.fill_cache", __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_7sweepea_13CursorWrapper_12fill_cache(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_13CursorWrapper_12fill_cache(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fill_cache (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fill_cache") < 0)) __PYX_ERR(0, 908, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_n = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fill_cache", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 908, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.CursorWrapper.fill_cache", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_13CursorWrapper_11fill_cache(((struct __pyx_obj_7sweepea_CursorWrapper *)__pyx_v_self), __pyx_v_n);

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

static PyObject *__pyx_pf_7sweepea_13CursorWrapper_11fill_cache(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7sweepea_13CursorWrapper_fill_cache __pyx_t_2;
  __Pyx_RefNannySetupContext("fill_cache", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.n = __pyx_v_n;
  __pyx_t_1 = __pyx_vtabptr_7sweepea_CursorWrapper->fill_cache(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __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("sweepea.CursorWrapper.fill_cache", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":924
 * 
 * 
 * cdef dict_transform(CursorWrapper cursor_wrapper, tuple row):             # <<<<<<<<<<<<<<
 *     cdef:
 *         basestring column
 */

static PyObject *__pyx_f_7sweepea_dict_transform(struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_cursor_wrapper, PyObject *__pyx_v_row) {
  PyObject *__pyx_v_column = 0;
  PyObject *__pyx_v_accum = 0;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("dict_transform", 0);

  /* "sweepea.pyx":927
 *     cdef:
 *         basestring column
 *         dict accum = {}             # <<<<<<<<<<<<<<
 *         int i
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 927, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_accum = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":930
 *         int i
 * 
 *     for i, column in enumerate(cursor_wrapper.columns):             # <<<<<<<<<<<<<<
 *         accum[column] = row[i]
 * 
 */
  __pyx_t_2 = 0;
  __pyx_t_1 = __pyx_v_cursor_wrapper->columns; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
  for (;;) {
    if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 930, __pyx_L1_error)
    #else
    __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 930, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_column, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_v_i = __pyx_t_2;
    __pyx_t_2 = (__pyx_t_2 + 1);

    /* "sweepea.pyx":931
 * 
 *     for i, column in enumerate(cursor_wrapper.columns):
 *         accum[column] = row[i]             # <<<<<<<<<<<<<<
 * 
 *     return accum
 */
    if (unlikely(__pyx_v_row == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 931, __pyx_L1_error)
    }
    __pyx_t_4 = __Pyx_GetItemInt_Tuple(__pyx_v_row, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(PyDict_SetItem(__pyx_v_accum, __pyx_v_column, __pyx_t_4) < 0)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "sweepea.pyx":930
 *         int i
 * 
 *     for i, column in enumerate(cursor_wrapper.columns):             # <<<<<<<<<<<<<<
 *         accum[column] = row[i]
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":933
 *         accum[column] = row[i]
 * 
 *     return accum             # <<<<<<<<<<<<<<
 * 
 * def DictCursorWrapper(cursor):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_accum);
  __pyx_r = __pyx_v_accum;
  goto __pyx_L0;

  /* "sweepea.pyx":924
 * 
 * 
 * cdef dict_transform(CursorWrapper cursor_wrapper, tuple row):             # <<<<<<<<<<<<<<
 *     cdef:
 *         basestring column
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("sweepea.dict_transform", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_column);
  __Pyx_XDECREF(__pyx_v_accum);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":935
 *     return accum
 * 
 * def DictCursorWrapper(cursor):             # <<<<<<<<<<<<<<
 *     return CursorWrapper(cursor, dict_transform)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5DictCursorWrapper(PyObject *__pyx_self, PyObject *__pyx_v_cursor); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5DictCursorWrapper = {"DictCursorWrapper", (PyCFunction)__pyx_pw_7sweepea_5DictCursorWrapper, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_5DictCursorWrapper(PyObject *__pyx_self, PyObject *__pyx_v_cursor) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("DictCursorWrapper (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_4DictCursorWrapper(__pyx_self, ((PyObject *)__pyx_v_cursor));

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

static PyObject *__pyx_pf_7sweepea_4DictCursorWrapper(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_cursor) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("DictCursorWrapper", 0);

  /* "sweepea.pyx":936
 * 
 * def DictCursorWrapper(cursor):
 *     return CursorWrapper(cursor, dict_transform)             # <<<<<<<<<<<<<<
 * 
 * cdef class NamedTupleCursorWrapper(CursorWrapper)  # Forward declaration.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_CFunc_object____CursorWrapper____tuple___to_py(__pyx_f_7sweepea_dict_transform); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_cursor);
  __Pyx_GIVEREF(__pyx_v_cursor);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_cursor);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea_CursorWrapper), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __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;

  /* "sweepea.pyx":935
 *     return accum
 * 
 * def DictCursorWrapper(cursor):             # <<<<<<<<<<<<<<
 *     return CursorWrapper(cursor, dict_transform)
 * 
 */

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

/* "sweepea.pyx":940
 * cdef class NamedTupleCursorWrapper(CursorWrapper)  # Forward declaration.
 * 
 * cdef namedtuple_transform(NamedTupleCursorWrapper cursor_wrapper, tuple row):             # <<<<<<<<<<<<<<
 *     return cursor_wrapper.tuple_class(*row)
 * 
 */

static PyObject *__pyx_f_7sweepea_namedtuple_transform(struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *__pyx_v_cursor_wrapper, PyObject *__pyx_v_row) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("namedtuple_transform", 0);

  /* "sweepea.pyx":941
 * 
 * cdef namedtuple_transform(NamedTupleCursorWrapper cursor_wrapper, tuple row):
 *     return cursor_wrapper.tuple_class(*row)             # <<<<<<<<<<<<<<
 * 
 * cdef class NamedTupleCursorWrapper(CursorWrapper):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_row == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 941, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_cursor_wrapper->tuple_class, __pyx_v_row, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":940
 * cdef class NamedTupleCursorWrapper(CursorWrapper)  # Forward declaration.
 * 
 * cdef namedtuple_transform(NamedTupleCursorWrapper cursor_wrapper, tuple row):             # <<<<<<<<<<<<<<
 *     return cursor_wrapper.tuple_class(*row)
 * 
 */

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

/* "sweepea.pyx":947
 *         object tuple_class
 * 
 *     cdef initialize(self):             # <<<<<<<<<<<<<<
 *         CursorWrapper.initialize(self)
 *         self.tuple_class = namedtuple('Row', self.columns)
 */

static PyObject *__pyx_f_7sweepea_23NamedTupleCursorWrapper_initialize(struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("initialize", 0);

  /* "sweepea.pyx":948
 * 
 *     cdef initialize(self):
 *         CursorWrapper.initialize(self)             # <<<<<<<<<<<<<<
 *         self.tuple_class = namedtuple('Row', self.columns)
 *         self.transform = namedtuple_transform
 */
  __pyx_t_1 = __pyx_f_7sweepea_13CursorWrapper_initialize(((struct __pyx_obj_7sweepea_CursorWrapper *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":949
 *     cdef initialize(self):
 *         CursorWrapper.initialize(self)
 *         self.tuple_class = namedtuple('Row', self.columns)             # <<<<<<<<<<<<<<
 *         self.transform = namedtuple_transform
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_namedtuple); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_n_s_Row);
  __Pyx_GIVEREF(__pyx_n_s_Row);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_n_s_Row);
  __Pyx_INCREF(__pyx_v_self->__pyx_base.columns);
  __Pyx_GIVEREF(__pyx_v_self->__pyx_base.columns);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_self->__pyx_base.columns);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 949, __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_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->tuple_class);
  __Pyx_DECREF(__pyx_v_self->tuple_class);
  __pyx_v_self->tuple_class = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":950
 *         CursorWrapper.initialize(self)
 *         self.tuple_class = namedtuple('Row', self.columns)
 *         self.transform = namedtuple_transform             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py(__pyx_f_7sweepea_namedtuple_transform); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.transform);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.transform);
  __pyx_v_self->__pyx_base.transform = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":947
 *         object tuple_class
 * 
 *     cdef initialize(self):             # <<<<<<<<<<<<<<
 *         CursorWrapper.initialize(self)
 *         self.tuple_class = namedtuple('Row', self.columns)
 */

  /* 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("sweepea.NamedTupleCursorWrapper.initialize", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":954
 * 
 * cdef class _callable_context_manager(object):
 *     def __call__(self, fn):             # <<<<<<<<<<<<<<
 *         def inner(*args, **kwargs):
 *             with self:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_25_callable_context_manager_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_25_callable_context_manager_1__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_fn = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fn,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) {
        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_fn)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 954, __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_fn = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 954, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea._callable_context_manager.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_25_callable_context_manager___call__(((struct __pyx_obj_7sweepea__callable_context_manager *)__pyx_v_self), __pyx_v_fn);

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

/* "sweepea.pyx":955
 * cdef class _callable_context_manager(object):
 *     def __call__(self, fn):
 *         def inner(*args, **kwargs):             # <<<<<<<<<<<<<<
 *             with self:
 *                 return fn(*args, **kwargs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_25_callable_context_manager_8__call___1inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_25_callable_context_manager_8__call___1inner = {"inner", (PyCFunction)__pyx_pw_7sweepea_25_callable_context_manager_8__call___1inner, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_25_callable_context_manager_8__call___1inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inner (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "inner", 1))) return NULL;
  if (unlikely(__pyx_kwds)) {
    __pyx_v_kwargs = PyDict_Copy(__pyx_kwds); if (unlikely(!__pyx_v_kwargs)) return NULL;
    __Pyx_GOTREF(__pyx_v_kwargs);
  } else {
    __pyx_v_kwargs = NULL;
  }
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7sweepea_25_callable_context_manager_8__call___inner(__pyx_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7sweepea_25_callable_context_manager_8__call___inner(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__ *__pyx_cur_scope;
  struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__ *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("inner", 0);
  __pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "sweepea.pyx":956
 *     def __call__(self, fn):
 *         def inner(*args, **kwargs):
 *             with self:             # <<<<<<<<<<<<<<
 *                 return fn(*args, **kwargs)
 *         return inner
 */
  /*with:*/ {
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 956, __pyx_L1_error) }
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_exit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 956, __pyx_L3_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, 956, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        /*try:*/ {

          /* "sweepea.pyx":957
 *         def inner(*args, **kwargs):
 *             with self:
 *                 return fn(*args, **kwargs)             # <<<<<<<<<<<<<<
 *         return inner
 * 
 */
          __Pyx_XDECREF(__pyx_r);
          if (unlikely(!__pyx_cur_scope->__pyx_v_fn)) { __Pyx_RaiseClosureNameError("fn"); __PYX_ERR(0, 957, __pyx_L7_error) }
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_fn, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 957, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_r = __pyx_t_2;
          __pyx_t_2 = 0;
          goto __pyx_L11_try_return;

          /* "sweepea.pyx":956
 *     def __call__(self, fn):
 *         def inner(*args, **kwargs):
 *             with self:             # <<<<<<<<<<<<<<
 *                 return fn(*args, **kwargs)
 *         return inner
 */
        }
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("sweepea._callable_context_manager.__call__.inner", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 956, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_8 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 956, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 956, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (__pyx_t_10 < 0) __PYX_ERR(0, 956, __pyx_L9_except_error)
          __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0);
          if (__pyx_t_11) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_4);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_4);
            __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_4 = 0; 
            __PYX_ERR(0, 956, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        goto __pyx_L1_error;
        __pyx_L11_try_return:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        goto __pyx_L4_return;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_1) {
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__9, NULL);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 956, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L4_return: {
        __pyx_t_7 = __pyx_r;
        __pyx_r = 0;
        if (__pyx_t_1) {
          __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__10, NULL);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 956, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        }
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L0;
      }
      __pyx_L6:;
    }
    goto __pyx_L18;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    goto __pyx_L1_error;
    __pyx_L18:;
  }

  /* "sweepea.pyx":955
 * cdef class _callable_context_manager(object):
 *     def __call__(self, fn):
 *         def inner(*args, **kwargs):             # <<<<<<<<<<<<<<
 *             with self:
 *                 return fn(*args, **kwargs)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("sweepea._callable_context_manager.__call__.inner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":954
 * 
 * cdef class _callable_context_manager(object):
 *     def __call__(self, fn):             # <<<<<<<<<<<<<<
 *         def inner(*args, **kwargs):
 *             with self:
 */

static PyObject *__pyx_pf_7sweepea_25_callable_context_manager___call__(struct __pyx_obj_7sweepea__callable_context_manager *__pyx_v_self, PyObject *__pyx_v_fn) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__ *__pyx_cur_scope;
  PyObject *__pyx_v_inner = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__call__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__ *)__pyx_tp_new_7sweepea___pyx_scope_struct_2___call__(__pyx_ptype_7sweepea___pyx_scope_struct_2___call__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_fn = __pyx_v_fn;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_fn);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_fn);

  /* "sweepea.pyx":955
 * cdef class _callable_context_manager(object):
 *     def __call__(self, fn):
 *         def inner(*args, **kwargs):             # <<<<<<<<<<<<<<
 *             with self:
 *                 return fn(*args, **kwargs)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_25_callable_context_manager_8__call___1inner, 0, __pyx_n_s_call___locals_inner, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_inner = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":958
 *             with self:
 *                 return fn(*args, **kwargs)
 *         return inner             # <<<<<<<<<<<<<<
 * 
 * __sentinel__ = object()
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_inner);
  __pyx_r = __pyx_v_inner;
  goto __pyx_L0;

  /* "sweepea.pyx":954
 * 
 * cdef class _callable_context_manager(object):
 *     def __call__(self, fn):             # <<<<<<<<<<<<<<
 *         def inner(*args, **kwargs):
 *             with self:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea._callable_context_manager.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inner);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":963
 * 
 * 
 * def __status__(flag, return_highwater=False):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a sqlite3_status() call for a particular flag as a property of the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7__status__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7sweepea_6__status__[] = "\n    Expose a sqlite3_status() call for a particular flag as a property of the\n    Database object.\n    ";
static PyMethodDef __pyx_mdef_7sweepea_7__status__ = {"__status__", (PyCFunction)__pyx_pw_7sweepea_7__status__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7sweepea_6__status__};
static PyObject *__pyx_pw_7sweepea_7__status__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_flag = 0;
  PyObject *__pyx_v_return_highwater = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__status__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_return_highwater,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_flag)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_return_highwater);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__status__") < 0)) __PYX_ERR(0, 963, __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_flag = values[0];
    __pyx_v_return_highwater = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__status__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 963, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.__status__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6__status__(__pyx_self, __pyx_v_flag, __pyx_v_return_highwater);

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

/* "sweepea.pyx":968
 *     Database object.
 *     """
 *     def getter(self):             # <<<<<<<<<<<<<<
 *         cdef int current, highwater
 *         cdef int rc = sqlite3_status(flag, &current, &highwater, 0)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10__status___1getter(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10__status___1getter = {"getter", (PyCFunction)__pyx_pw_7sweepea_10__status___1getter, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_10__status___1getter(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getter (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_10__status___getter(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_10__status___getter(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__ *__pyx_cur_scope;
  struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__ *__pyx_outer_scope;
  int __pyx_v_current;
  int __pyx_v_highwater;
  int __pyx_v_rc;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("getter", 0);
  __pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "sweepea.pyx":970
 *     def getter(self):
 *         cdef int current, highwater
 *         cdef int rc = sqlite3_status(flag, &current, &highwater, 0)             # <<<<<<<<<<<<<<
 *         if rc == SQLITE_OK:
 *             if return_highwater:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_flag)) { __Pyx_RaiseClosureNameError("flag"); __PYX_ERR(0, 970, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_flag); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 970, __pyx_L1_error)
  __pyx_v_rc = sqlite3_status(__pyx_t_1, (&__pyx_v_current), (&__pyx_v_highwater), 0);

  /* "sweepea.pyx":971
 *         cdef int current, highwater
 *         cdef int rc = sqlite3_status(flag, &current, &highwater, 0)
 *         if rc == SQLITE_OK:             # <<<<<<<<<<<<<<
 *             if return_highwater:
 *                 return highwater
 */
  __pyx_t_2 = ((__pyx_v_rc == SQLITE_OK) != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":972
 *         cdef int rc = sqlite3_status(flag, &current, &highwater, 0)
 *         if rc == SQLITE_OK:
 *             if return_highwater:             # <<<<<<<<<<<<<<
 *                 return highwater
 *             else:
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_return_highwater)) { __Pyx_RaiseClosureNameError("return_highwater"); __PYX_ERR(0, 972, __pyx_L1_error) }
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_return_highwater); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 972, __pyx_L1_error)
    if (__pyx_t_2) {

      /* "sweepea.pyx":973
 *         if rc == SQLITE_OK:
 *             if return_highwater:
 *                 return highwater             # <<<<<<<<<<<<<<
 *             else:
 *                 return (current, highwater)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_highwater); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 973, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "sweepea.pyx":972
 *         cdef int rc = sqlite3_status(flag, &current, &highwater, 0)
 *         if rc == SQLITE_OK:
 *             if return_highwater:             # <<<<<<<<<<<<<<
 *                 return highwater
 *             else:
 */
    }

    /* "sweepea.pyx":975
 *                 return highwater
 *             else:
 *                 return (current, highwater)             # <<<<<<<<<<<<<<
 *         else:
 *             raise Exception('Error requesting status: %s' % rc)
 */
    /*else*/ {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_current); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 975, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_highwater); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 975, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 975, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
      __pyx_t_3 = 0;
      __pyx_t_4 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;
    }

    /* "sweepea.pyx":971
 *         cdef int current, highwater
 *         cdef int rc = sqlite3_status(flag, &current, &highwater, 0)
 *         if rc == SQLITE_OK:             # <<<<<<<<<<<<<<
 *             if return_highwater:
 *                 return highwater
 */
  }

  /* "sweepea.pyx":977
 *                 return (current, highwater)
 *         else:
 *             raise Exception('Error requesting status: %s' % rc)             # <<<<<<<<<<<<<<
 *     return property(getter)
 * 
 */
  /*else*/ {
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Error_requesting_status_s, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 977, __pyx_L1_error)
  }

  /* "sweepea.pyx":968
 *     Database object.
 *     """
 *     def getter(self):             # <<<<<<<<<<<<<<
 *         cdef int current, highwater
 *         cdef int rc = sqlite3_status(flag, &current, &highwater, 0)
 */

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

/* "sweepea.pyx":963
 * 
 * 
 * def __status__(flag, return_highwater=False):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a sqlite3_status() call for a particular flag as a property of the
 */

static PyObject *__pyx_pf_7sweepea_6__status__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_return_highwater) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__ *__pyx_cur_scope;
  PyObject *__pyx_v_getter = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__status__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__ *)__pyx_tp_new_7sweepea___pyx_scope_struct_3___status__(__pyx_ptype_7sweepea___pyx_scope_struct_3___status__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_flag = __pyx_v_flag;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_flag);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_flag);
  __pyx_cur_scope->__pyx_v_return_highwater = __pyx_v_return_highwater;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_return_highwater);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_return_highwater);

  /* "sweepea.pyx":968
 *     Database object.
 *     """
 *     def getter(self):             # <<<<<<<<<<<<<<
 *         cdef int current, highwater
 *         cdef int rc = sqlite3_status(flag, &current, &highwater, 0)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10__status___1getter, 0, __pyx_n_s_status___locals_getter, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_getter = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":978
 *         else:
 *             raise Exception('Error requesting status: %s' % rc)
 *     return property(getter)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_getter);
  __Pyx_GIVEREF(__pyx_v_getter);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_getter);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __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;

  /* "sweepea.pyx":963
 * 
 * 
 * def __status__(flag, return_highwater=False):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a sqlite3_status() call for a particular flag as a property of the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("sweepea.__status__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_getter);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":981
 * 
 * 
 * def __dbstatus__(flag, return_highwater=False, return_current=False):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a sqlite3_dbstatus() call for a particular flag as a property of the
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_9__dbstatus__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7sweepea_8__dbstatus__[] = "\n    Expose a sqlite3_dbstatus() call for a particular flag as a property of the\n    Database instance. Unlike sqlite3_status(), the dbstatus properties pertain\n    to the current connection.\n    ";
static PyMethodDef __pyx_mdef_7sweepea_9__dbstatus__ = {"__dbstatus__", (PyCFunction)__pyx_pw_7sweepea_9__dbstatus__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7sweepea_8__dbstatus__};
static PyObject *__pyx_pw_7sweepea_9__dbstatus__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_flag = 0;
  PyObject *__pyx_v_return_highwater = 0;
  PyObject *__pyx_v_return_current = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dbstatus__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flag,&__pyx_n_s_return_highwater,&__pyx_n_s_return_current,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_False);
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flag)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_return_highwater);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_return_current);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__dbstatus__") < 0)) __PYX_ERR(0, 981, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_flag = values[0];
    __pyx_v_return_highwater = values[1];
    __pyx_v_return_current = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__dbstatus__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 981, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.__dbstatus__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8__dbstatus__(__pyx_self, __pyx_v_flag, __pyx_v_return_highwater, __pyx_v_return_current);

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

/* "sweepea.pyx":987
 *     to the current connection.
 *     """
 *     def getter(Database self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int current, hi
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_12__dbstatus___1getter(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_12__dbstatus___1getter = {"getter", (PyCFunction)__pyx_pw_7sweepea_12__dbstatus___1getter, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_12__dbstatus___1getter(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("getter (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_self), __pyx_ptype_7sweepea_Database, 1, "self", 0))) __PYX_ERR(0, 987, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_12__dbstatus___getter(__pyx_self, ((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_12__dbstatus___getter(PyObject *__pyx_self, struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__ *__pyx_cur_scope;
  struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__ *__pyx_outer_scope;
  int __pyx_v_current;
  int __pyx_v_hi;
  pysqlite_Connection *__pyx_v_conn;
  int __pyx_v_rc;
  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;
  __Pyx_RefNannySetupContext("getter", 0);
  __pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "sweepea.pyx":990
 *         cdef:
 *             int current, hi
 *             pysqlite_Connection *conn = <pysqlite_Connection *>(self._local.conn)             # <<<<<<<<<<<<<<
 *             int rc = sqlite3_db_status(conn.db, flag, &current, &hi, 0)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_conn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_conn = ((pysqlite_Connection *)__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":991
 *             int current, hi
 *             pysqlite_Connection *conn = <pysqlite_Connection *>(self._local.conn)
 *             int rc = sqlite3_db_status(conn.db, flag, &current, &hi, 0)             # <<<<<<<<<<<<<<
 * 
 *         if rc != SQLITE_OK:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_flag)) { __Pyx_RaiseClosureNameError("flag"); __PYX_ERR(0, 991, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_cur_scope->__pyx_v_flag); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L1_error)
  __pyx_v_rc = sqlite3_db_status(__pyx_v_conn->db, __pyx_t_2, (&__pyx_v_current), (&__pyx_v_hi), 0);

  /* "sweepea.pyx":993
 *             int rc = sqlite3_db_status(conn.db, flag, &current, &hi, 0)
 * 
 *         if rc != SQLITE_OK:             # <<<<<<<<<<<<<<
 *             raise Exception('Error requesting db status: %s' % rc)
 * 
 */
  __pyx_t_3 = ((__pyx_v_rc != SQLITE_OK) != 0);
  if (__pyx_t_3) {

    /* "sweepea.pyx":994
 * 
 *         if rc != SQLITE_OK:
 *             raise Exception('Error requesting db status: %s' % rc)             # <<<<<<<<<<<<<<
 * 
 *         if return_highwater:
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_rc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Error_requesting_db_status_s, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_Exception, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 994, __pyx_L1_error)

    /* "sweepea.pyx":993
 *             int rc = sqlite3_db_status(conn.db, flag, &current, &hi, 0)
 * 
 *         if rc != SQLITE_OK:             # <<<<<<<<<<<<<<
 *             raise Exception('Error requesting db status: %s' % rc)
 * 
 */
  }

  /* "sweepea.pyx":996
 *             raise Exception('Error requesting db status: %s' % rc)
 * 
 *         if return_highwater:             # <<<<<<<<<<<<<<
 *             return hi
 *         elif return_current:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_return_highwater)) { __Pyx_RaiseClosureNameError("return_highwater"); __PYX_ERR(0, 996, __pyx_L1_error) }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_return_highwater); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 996, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "sweepea.pyx":997
 * 
 *         if return_highwater:
 *             return hi             # <<<<<<<<<<<<<<
 *         elif return_current:
 *             return current
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_hi); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "sweepea.pyx":996
 *             raise Exception('Error requesting db status: %s' % rc)
 * 
 *         if return_highwater:             # <<<<<<<<<<<<<<
 *             return hi
 *         elif return_current:
 */
  }

  /* "sweepea.pyx":998
 *         if return_highwater:
 *             return hi
 *         elif return_current:             # <<<<<<<<<<<<<<
 *             return current
 *         else:
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_return_current)) { __Pyx_RaiseClosureNameError("return_current"); __PYX_ERR(0, 998, __pyx_L1_error) }
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_return_current); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 998, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "sweepea.pyx":999
 *             return hi
 *         elif return_current:
 *             return current             # <<<<<<<<<<<<<<
 *         else:
 *             return (current, hi)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_current); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "sweepea.pyx":998
 *         if return_highwater:
 *             return hi
 *         elif return_current:             # <<<<<<<<<<<<<<
 *             return current
 *         else:
 */
  }

  /* "sweepea.pyx":1001
 *             return current
 *         else:
 *             return (current, hi)             # <<<<<<<<<<<<<<
 *     return property(getter)
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_current); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_hi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
    __pyx_t_4 = 0;
    __pyx_t_1 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "sweepea.pyx":987
 *     to the current connection.
 *     """
 *     def getter(Database self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int current, hi
 */

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

/* "sweepea.pyx":981
 * 
 * 
 * def __dbstatus__(flag, return_highwater=False, return_current=False):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a sqlite3_dbstatus() call for a particular flag as a property of the
 */

static PyObject *__pyx_pf_7sweepea_8__dbstatus__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flag, PyObject *__pyx_v_return_highwater, PyObject *__pyx_v_return_current) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__ *__pyx_cur_scope;
  PyObject *__pyx_v_getter = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__dbstatus__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__ *)__pyx_tp_new_7sweepea___pyx_scope_struct_4___dbstatus__(__pyx_ptype_7sweepea___pyx_scope_struct_4___dbstatus__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_flag = __pyx_v_flag;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_flag);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_flag);
  __pyx_cur_scope->__pyx_v_return_highwater = __pyx_v_return_highwater;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_return_highwater);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_return_highwater);
  __pyx_cur_scope->__pyx_v_return_current = __pyx_v_return_current;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_return_current);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_return_current);

  /* "sweepea.pyx":987
 *     to the current connection.
 *     """
 *     def getter(Database self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int current, hi
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_12__dbstatus___1getter, 0, __pyx_n_s_dbstatus___locals_getter, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_getter = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1002
 *         else:
 *             return (current, hi)
 *     return property(getter)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_getter);
  __Pyx_GIVEREF(__pyx_v_getter);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_getter);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1002, __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;

  /* "sweepea.pyx":981
 * 
 * 
 * def __dbstatus__(flag, return_highwater=False, return_current=False):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a sqlite3_dbstatus() call for a particular flag as a property of the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("sweepea.__dbstatus__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_getter);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1005
 * 
 * 
 * def __pragma__(name):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a SQLite PRAGMA operation as a property of the Database, with a
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_11__pragma__(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7sweepea_10__pragma__[] = "\n    Expose a SQLite PRAGMA operation as a property of the Database, with a\n    getter and setter.\n    ";
static PyMethodDef __pyx_mdef_7sweepea_11__pragma__ = {"__pragma__", (PyCFunction)__pyx_pw_7sweepea_11__pragma__, METH_O, __pyx_doc_7sweepea_10__pragma__};
static PyObject *__pyx_pw_7sweepea_11__pragma__(PyObject *__pyx_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pragma__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_10__pragma__(__pyx_self, ((PyObject *)__pyx_v_name));

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

/* "sweepea.pyx":1010
 *     getter and setter.
 *     """
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *         return self.pragma(name)
 *     def __set__(self, value):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10__pragma___1__get__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10__pragma___1__get__ = {"__get__", (PyCFunction)__pyx_pw_7sweepea_10__pragma___1__get__, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_10__pragma___1__get__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_10__pragma_____get__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_10__pragma_____get__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *__pyx_cur_scope;
  struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *__pyx_outer_scope;
  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("__get__", 0);
  __pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "sweepea.pyx":1011
 *     """
 *     def __get__(self):
 *         return self.pragma(name)             # <<<<<<<<<<<<<<
 *     def __set__(self, value):
 *         return self.pragma(name, value)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pragma); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(0, 1011, __pyx_L1_error) }
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_cur_scope->__pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1011, __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_cur_scope->__pyx_v_name);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_cur_scope->__pyx_v_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __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;

  /* "sweepea.pyx":1010
 *     getter and setter.
 *     """
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *         return self.pragma(name)
 *     def __set__(self, value):
 */

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

/* "sweepea.pyx":1012
 *     def __get__(self):
 *         return self.pragma(name)
 *     def __set__(self, value):             # <<<<<<<<<<<<<<
 *         return self.pragma(name, value)
 *     return property(__get__, __set__)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10__pragma___3__set__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10__pragma___3__set__ = {"__set__", (PyCFunction)__pyx_pw_7sweepea_10__pragma___3__set__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10__pragma___3__set__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,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_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__set__", 1, 2, 2, 1); __PYX_ERR(0, 1012, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__set__") < 0)) __PYX_ERR(0, 1012, __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_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__set__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1012, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.__pragma__.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10__pragma___2__set__(__pyx_self, __pyx_v_self, __pyx_v_value);

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

static PyObject *__pyx_pf_7sweepea_10__pragma___2__set__(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *__pyx_cur_scope;
  struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "sweepea.pyx":1013
 *         return self.pragma(name)
 *     def __set__(self, value):
 *         return self.pragma(name, value)             # <<<<<<<<<<<<<<
 *     return property(__get__, __set__)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_pragma); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(0, 1013, __pyx_L1_error) }
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_cur_scope->__pyx_v_name);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_value);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1013, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1012
 *     def __get__(self):
 *         return self.pragma(name)
 *     def __set__(self, value):             # <<<<<<<<<<<<<<
 *         return self.pragma(name, value)
 *     return property(__get__, __set__)
 */

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

/* "sweepea.pyx":1005
 * 
 * 
 * def __pragma__(name):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a SQLite PRAGMA operation as a property of the Database, with a
 */

static PyObject *__pyx_pf_7sweepea_10__pragma__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_name) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *__pyx_cur_scope;
  PyObject *__pyx_v___get__ = 0;
  PyObject *__pyx_v___set__ = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__pragma__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *)__pyx_tp_new_7sweepea___pyx_scope_struct_5___pragma__(__pyx_ptype_7sweepea___pyx_scope_struct_5___pragma__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_name = __pyx_v_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name);

  /* "sweepea.pyx":1010
 *     getter and setter.
 *     """
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *         return self.pragma(name)
 *     def __set__(self, value):
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10__pragma___1__get__, 0, __pyx_n_s_pragma___locals___get, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v___get__ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1012
 *     def __get__(self):
 *         return self.pragma(name)
 *     def __set__(self, value):             # <<<<<<<<<<<<<<
 *         return self.pragma(name, value)
 *     return property(__get__, __set__)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10__pragma___3__set__, 0, __pyx_n_s_pragma___locals___set, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v___set__ = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1014
 *     def __set__(self, value):
 *         return self.pragma(name, value)
 *     return property(__get__, __set__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v___get__);
  __Pyx_GIVEREF(__pyx_v___get__);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v___get__);
  __Pyx_INCREF(__pyx_v___set__);
  __Pyx_GIVEREF(__pyx_v___set__);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v___set__);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_property, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1014, __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;

  /* "sweepea.pyx":1005
 * 
 * 
 * def __pragma__(name):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a SQLite PRAGMA operation as a property of the Database, with a
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("sweepea.__pragma__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___get__);
  __Pyx_XDECREF(__pyx_v___set__);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1017
 * 
 * 
 * cdef inline int _check_connection(pysqlite_Connection *conn) except -1:             # <<<<<<<<<<<<<<
 *     """
 *     Check that the underlying SQLite database connection is usable. Raises an
 */

static CYTHON_INLINE int __pyx_f_7sweepea__check_connection(pysqlite_Connection *__pyx_v_conn) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("_check_connection", 0);

  /* "sweepea.pyx":1022
 *     InterfaceError if the connection is either uninitialized or closed.
 *     """
 *     if not conn.initialized:             # <<<<<<<<<<<<<<
 *         raise InterfaceError('Connection not initialized.')
 *     if not conn.db:
 */
  __pyx_t_1 = ((!(__pyx_v_conn->initialized != 0)) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":1023
 *     """
 *     if not conn.initialized:
 *         raise InterfaceError('Connection not initialized.')             # <<<<<<<<<<<<<<
 *     if not conn.db:
 *         raise InterfaceError('Cannot operate on closed database.')
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1023, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1023, __pyx_L1_error)

    /* "sweepea.pyx":1022
 *     InterfaceError if the connection is either uninitialized or closed.
 *     """
 *     if not conn.initialized:             # <<<<<<<<<<<<<<
 *         raise InterfaceError('Connection not initialized.')
 *     if not conn.db:
 */
  }

  /* "sweepea.pyx":1024
 *     if not conn.initialized:
 *         raise InterfaceError('Connection not initialized.')
 *     if not conn.db:             # <<<<<<<<<<<<<<
 *         raise InterfaceError('Cannot operate on closed database.')
 *     return 1
 */
  __pyx_t_1 = ((!(__pyx_v_conn->db != 0)) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":1025
 *         raise InterfaceError('Connection not initialized.')
 *     if not conn.db:
 *         raise InterfaceError('Cannot operate on closed database.')             # <<<<<<<<<<<<<<
 *     return 1
 * 
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1025, __pyx_L1_error)

    /* "sweepea.pyx":1024
 *     if not conn.initialized:
 *         raise InterfaceError('Connection not initialized.')
 *     if not conn.db:             # <<<<<<<<<<<<<<
 *         raise InterfaceError('Cannot operate on closed database.')
 *     return 1
 */
  }

  /* "sweepea.pyx":1026
 *     if not conn.db:
 *         raise InterfaceError('Cannot operate on closed database.')
 *     return 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 1;
  goto __pyx_L0;

  /* "sweepea.pyx":1017
 * 
 * 
 * cdef inline int _check_connection(pysqlite_Connection *conn) except -1:             # <<<<<<<<<<<<<<
 *     """
 *     Check that the underlying SQLite database connection is usable. Raises an
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("sweepea._check_connection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1029
 * 
 * 
 * cdef _sqlite_to_python(sqlite3_context *context, int n, sqlite3_value **args):             # <<<<<<<<<<<<<<
 *     # Convert a value stored in a sqlite3_context object into an appropriate
 *     # Python object. For instance, transform a parameter to a user-defined
 */

static PyObject *__pyx_f_7sweepea__sqlite_to_python(CYTHON_UNUSED sqlite3_context *__pyx_v_context, int __pyx_v_n, sqlite3_value **__pyx_v_args) {
  int __pyx_v_i;
  int __pyx_v_value_type;
  PyObject *__pyx_v_accum = 0;
  sqlite3_value *__pyx_v_value;
  PyObject *__pyx_v_obj = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  void const *__pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("_sqlite_to_python", 0);

  /* "sweepea.pyx":1036
 *         int i
 *         int value_type
 *         list accum = []             # <<<<<<<<<<<<<<
 *         sqlite3_value *value
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_accum = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1039
 *         sqlite3_value *value
 * 
 *     for i in range(n):             # <<<<<<<<<<<<<<
 *         value = args[i]
 *         value_type = sqlite3_value_type(value)
 */
  __pyx_t_2 = __pyx_v_n;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "sweepea.pyx":1040
 * 
 *     for i in range(n):
 *         value = args[i]             # <<<<<<<<<<<<<<
 *         value_type = sqlite3_value_type(value)
 * 
 */
    __pyx_v_value = (__pyx_v_args[__pyx_v_i]);

    /* "sweepea.pyx":1041
 *     for i in range(n):
 *         value = args[i]
 *         value_type = sqlite3_value_type(value)             # <<<<<<<<<<<<<<
 * 
 *         if value_type == SQLITE_INTEGER:
 */
    __pyx_v_value_type = sqlite3_value_type(__pyx_v_value);

    /* "sweepea.pyx":1043
 *         value_type = sqlite3_value_type(value)
 * 
 *         if value_type == SQLITE_INTEGER:             # <<<<<<<<<<<<<<
 *             obj = sqlite3_value_int(value)
 *         elif value_type == SQLITE_FLOAT:
 */
    __pyx_t_4 = ((__pyx_v_value_type == SQLITE_INTEGER) != 0);
    if (__pyx_t_4) {

      /* "sweepea.pyx":1044
 * 
 *         if value_type == SQLITE_INTEGER:
 *             obj = sqlite3_value_int(value)             # <<<<<<<<<<<<<<
 *         elif value_type == SQLITE_FLOAT:
 *             obj = sqlite3_value_double(value)
 */
      __pyx_t_1 = __Pyx_PyInt_From_int(sqlite3_value_int(__pyx_v_value)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "sweepea.pyx":1043
 *         value_type = sqlite3_value_type(value)
 * 
 *         if value_type == SQLITE_INTEGER:             # <<<<<<<<<<<<<<
 *             obj = sqlite3_value_int(value)
 *         elif value_type == SQLITE_FLOAT:
 */
      goto __pyx_L5;
    }

    /* "sweepea.pyx":1045
 *         if value_type == SQLITE_INTEGER:
 *             obj = sqlite3_value_int(value)
 *         elif value_type == SQLITE_FLOAT:             # <<<<<<<<<<<<<<
 *             obj = sqlite3_value_double(value)
 *         elif value_type == SQLITE_TEXT:
 */
    __pyx_t_4 = ((__pyx_v_value_type == SQLITE_FLOAT) != 0);
    if (__pyx_t_4) {

      /* "sweepea.pyx":1046
 *             obj = sqlite3_value_int(value)
 *         elif value_type == SQLITE_FLOAT:
 *             obj = sqlite3_value_double(value)             # <<<<<<<<<<<<<<
 *         elif value_type == SQLITE_TEXT:
 *             obj = str(sqlite3_value_text(value))
 */
      __pyx_t_1 = PyFloat_FromDouble(sqlite3_value_double(__pyx_v_value)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1046, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "sweepea.pyx":1045
 *         if value_type == SQLITE_INTEGER:
 *             obj = sqlite3_value_int(value)
 *         elif value_type == SQLITE_FLOAT:             # <<<<<<<<<<<<<<
 *             obj = sqlite3_value_double(value)
 *         elif value_type == SQLITE_TEXT:
 */
      goto __pyx_L5;
    }

    /* "sweepea.pyx":1047
 *         elif value_type == SQLITE_FLOAT:
 *             obj = sqlite3_value_double(value)
 *         elif value_type == SQLITE_TEXT:             # <<<<<<<<<<<<<<
 *             obj = str(sqlite3_value_text(value))
 *         elif value_type == SQLITE_BLOB:
 */
    __pyx_t_4 = ((__pyx_v_value_type == SQLITE_TEXT) != 0);
    if (__pyx_t_4) {

      /* "sweepea.pyx":1048
 *             obj = sqlite3_value_double(value)
 *         elif value_type == SQLITE_TEXT:
 *             obj = str(sqlite3_value_text(value))             # <<<<<<<<<<<<<<
 *         elif value_type == SQLITE_BLOB:
 *             obj = <bytes>sqlite3_value_blob(value)
 */
      __pyx_t_1 = __Pyx_PyBytes_FromCString(sqlite3_value_text(__pyx_v_value)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1048, __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, 1048, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "sweepea.pyx":1047
 *         elif value_type == SQLITE_FLOAT:
 *             obj = sqlite3_value_double(value)
 *         elif value_type == SQLITE_TEXT:             # <<<<<<<<<<<<<<
 *             obj = str(sqlite3_value_text(value))
 *         elif value_type == SQLITE_BLOB:
 */
      goto __pyx_L5;
    }

    /* "sweepea.pyx":1049
 *         elif value_type == SQLITE_TEXT:
 *             obj = str(sqlite3_value_text(value))
 *         elif value_type == SQLITE_BLOB:             # <<<<<<<<<<<<<<
 *             obj = <bytes>sqlite3_value_blob(value)
 *         else:
 */
    __pyx_t_4 = ((__pyx_v_value_type == SQLITE_BLOB) != 0);
    if (__pyx_t_4) {

      /* "sweepea.pyx":1050
 *             obj = str(sqlite3_value_text(value))
 *         elif value_type == SQLITE_BLOB:
 *             obj = <bytes>sqlite3_value_blob(value)             # <<<<<<<<<<<<<<
 *         else:
 *             obj = None
 */
      __pyx_t_6 = sqlite3_value_blob(__pyx_v_value);
      __pyx_t_1 = ((PyObject *)__pyx_t_6);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_XDECREF_SET(__pyx_v_obj, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "sweepea.pyx":1049
 *         elif value_type == SQLITE_TEXT:
 *             obj = str(sqlite3_value_text(value))
 *         elif value_type == SQLITE_BLOB:             # <<<<<<<<<<<<<<
 *             obj = <bytes>sqlite3_value_blob(value)
 *         else:
 */
      goto __pyx_L5;
    }

    /* "sweepea.pyx":1052
 *             obj = <bytes>sqlite3_value_blob(value)
 *         else:
 *             obj = None             # <<<<<<<<<<<<<<
 *         accum.append(obj)
 * 
 */
    /*else*/ {
      __Pyx_INCREF(Py_None);
      __Pyx_XDECREF_SET(__pyx_v_obj, Py_None);
    }
    __pyx_L5:;

    /* "sweepea.pyx":1053
 *         else:
 *             obj = None
 *         accum.append(obj)             # <<<<<<<<<<<<<<
 * 
 *     return accum
 */
    __pyx_t_7 = __Pyx_PyList_Append(__pyx_v_accum, __pyx_v_obj); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1053, __pyx_L1_error)
  }

  /* "sweepea.pyx":1055
 *         accum.append(obj)
 * 
 *     return accum             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_accum);
  __pyx_r = __pyx_v_accum;
  goto __pyx_L0;

  /* "sweepea.pyx":1029
 * 
 * 
 * cdef _sqlite_to_python(sqlite3_context *context, int n, sqlite3_value **args):             # <<<<<<<<<<<<<<
 *     # Convert a value stored in a sqlite3_context object into an appropriate
 *     # Python object. For instance, transform a parameter to a user-defined
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea._sqlite_to_python", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_accum);
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1058
 * 
 * 
 * cdef _python_to_sqlite(sqlite3_context *context, value):             # <<<<<<<<<<<<<<
 *     # Store a Python value in a sqlite3_context object. For instance, store the
 *     # result to a user-defined function call so it is accessible in SQLite.
 */

static PyObject *__pyx_f_7sweepea__python_to_sqlite(sqlite3_context *__pyx_v_context, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  sqlite3_int64 __pyx_t_4;
  double __pyx_t_5;
  char const *__pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  char const *__pyx_t_9;
  __Pyx_RefNannySetupContext("_python_to_sqlite", 0);

  /* "sweepea.pyx":1061
 *     # Store a Python value in a sqlite3_context object. For instance, store the
 *     # result to a user-defined function call so it is accessible in SQLite.
 *     if value is None:             # <<<<<<<<<<<<<<
 *         sqlite3_result_null(context)
 *     elif isinstance(value, (int, long)):
 */
  __pyx_t_1 = (__pyx_v_value == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1062
 *     # result to a user-defined function call so it is accessible in SQLite.
 *     if value is None:
 *         sqlite3_result_null(context)             # <<<<<<<<<<<<<<
 *     elif isinstance(value, (int, long)):
 *         sqlite3_result_int64(context, <sqlite3_int64>value)
 */
    sqlite3_result_null(__pyx_v_context);

    /* "sweepea.pyx":1061
 *     # Store a Python value in a sqlite3_context object. For instance, store the
 *     # result to a user-defined function call so it is accessible in SQLite.
 *     if value is None:             # <<<<<<<<<<<<<<
 *         sqlite3_result_null(context)
 *     elif isinstance(value, (int, long)):
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1063
 *     if value is None:
 *         sqlite3_result_null(context)
 *     elif isinstance(value, (int, long)):             # <<<<<<<<<<<<<<
 *         sqlite3_result_int64(context, <sqlite3_int64>value)
 *     elif isinstance(value, float):
 */
  __pyx_t_1 = PyInt_Check(__pyx_v_value); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (!__pyx_t_3) {
  } else {
    __pyx_t_2 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = PyLong_Check(__pyx_v_value); 
  __pyx_t_1 = (__pyx_t_3 != 0);
  __pyx_t_2 = __pyx_t_1;
  __pyx_L4_bool_binop_done:;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":1064
 *         sqlite3_result_null(context)
 *     elif isinstance(value, (int, long)):
 *         sqlite3_result_int64(context, <sqlite3_int64>value)             # <<<<<<<<<<<<<<
 *     elif isinstance(value, float):
 *         sqlite3_result_double(context, <double>value)
 */
    __pyx_t_4 = __Pyx_PyInt_As_sqlite3_int64(__pyx_v_value); if (unlikely((__pyx_t_4 == (sqlite3_int64)-1) && PyErr_Occurred())) __PYX_ERR(0, 1064, __pyx_L1_error)
    sqlite3_result_int64(__pyx_v_context, ((sqlite3_int64)__pyx_t_4));

    /* "sweepea.pyx":1063
 *     if value is None:
 *         sqlite3_result_null(context)
 *     elif isinstance(value, (int, long)):             # <<<<<<<<<<<<<<
 *         sqlite3_result_int64(context, <sqlite3_int64>value)
 *     elif isinstance(value, float):
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1065
 *     elif isinstance(value, (int, long)):
 *         sqlite3_result_int64(context, <sqlite3_int64>value)
 *     elif isinstance(value, float):             # <<<<<<<<<<<<<<
 *         sqlite3_result_double(context, <double>value)
 *     elif isinstance(value, basestring):
 */
  __pyx_t_1 = PyFloat_Check(__pyx_v_value); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1066
 *         sqlite3_result_int64(context, <sqlite3_int64>value)
 *     elif isinstance(value, float):
 *         sqlite3_result_double(context, <double>value)             # <<<<<<<<<<<<<<
 *     elif isinstance(value, basestring):
 *         sqlite3_result_text(context, <const char *>value, -1,
 */
    __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1066, __pyx_L1_error)
    sqlite3_result_double(__pyx_v_context, ((double)__pyx_t_5));

    /* "sweepea.pyx":1065
 *     elif isinstance(value, (int, long)):
 *         sqlite3_result_int64(context, <sqlite3_int64>value)
 *     elif isinstance(value, float):             # <<<<<<<<<<<<<<
 *         sqlite3_result_double(context, <double>value)
 *     elif isinstance(value, basestring):
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1067
 *     elif isinstance(value, float):
 *         sqlite3_result_double(context, <double>value)
 *     elif isinstance(value, basestring):             # <<<<<<<<<<<<<<
 *         sqlite3_result_text(context, <const char *>value, -1,
 *                             <sqlite3_destructor_type>-1)
 */
  __pyx_t_2 = __Pyx_PyBaseString_Check(__pyx_v_value); 
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":1068
 *         sqlite3_result_double(context, <double>value)
 *     elif isinstance(value, basestring):
 *         sqlite3_result_text(context, <const char *>value, -1,             # <<<<<<<<<<<<<<
 *                             <sqlite3_destructor_type>-1)
 *     elif isinstance(value, bool):
 */
    __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_v_value); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 1068, __pyx_L1_error)

    /* "sweepea.pyx":1069
 *     elif isinstance(value, basestring):
 *         sqlite3_result_text(context, <const char *>value, -1,
 *                             <sqlite3_destructor_type>-1)             # <<<<<<<<<<<<<<
 *     elif isinstance(value, bool):
 *         sqlite3_result_int(context, int(value))
 */
    sqlite3_result_text(__pyx_v_context, ((char const *)__pyx_t_6), -1, ((sqlite3_destructor_type)-1L));

    /* "sweepea.pyx":1067
 *     elif isinstance(value, float):
 *         sqlite3_result_double(context, <double>value)
 *     elif isinstance(value, basestring):             # <<<<<<<<<<<<<<
 *         sqlite3_result_text(context, <const char *>value, -1,
 *                             <sqlite3_destructor_type>-1)
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1070
 *         sqlite3_result_text(context, <const char *>value, -1,
 *                             <sqlite3_destructor_type>-1)
 *     elif isinstance(value, bool):             # <<<<<<<<<<<<<<
 *         sqlite3_result_int(context, int(value))
 *     else:
 */
  __pyx_t_7 = ((PyObject*)&PyBool_Type);
  __Pyx_INCREF(__pyx_t_7);
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_value, __pyx_t_7); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1070, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1071
 *                             <sqlite3_destructor_type>-1)
 *     elif isinstance(value, bool):
 *         sqlite3_result_int(context, int(value))             # <<<<<<<<<<<<<<
 *     else:
 *         sqlite3_result_error(context, 'Unsupported type %s' % type(value), -1)
 */
    __pyx_t_7 = __Pyx_PyNumber_Int(__pyx_v_value); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_7); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1071, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    sqlite3_result_int(__pyx_v_context, __pyx_t_8);

    /* "sweepea.pyx":1070
 *         sqlite3_result_text(context, <const char *>value, -1,
 *                             <sqlite3_destructor_type>-1)
 *     elif isinstance(value, bool):             # <<<<<<<<<<<<<<
 *         sqlite3_result_int(context, int(value))
 *     else:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1073
 *         sqlite3_result_int(context, int(value))
 *     else:
 *         sqlite3_result_error(context, 'Unsupported type %s' % type(value), -1)             # <<<<<<<<<<<<<<
 *         return SQLITE_ERROR
 * 
 */
  /*else*/ {
    __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Unsupported_type_s, ((PyObject *)Py_TYPE(__pyx_v_value))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1073, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = __Pyx_PyObject_AsString(__pyx_t_7); if (unlikely((!__pyx_t_9) && PyErr_Occurred())) __PYX_ERR(0, 1073, __pyx_L1_error)
    sqlite3_result_error(__pyx_v_context, __pyx_t_9, -1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "sweepea.pyx":1074
 *     else:
 *         sqlite3_result_error(context, 'Unsupported type %s' % type(value), -1)
 *         return SQLITE_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return SQLITE_OK
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_7 = __Pyx_PyInt_From_int(SQLITE_ERROR); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_r = __pyx_t_7;
    __pyx_t_7 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "sweepea.pyx":1076
 *         return SQLITE_ERROR
 * 
 *     return SQLITE_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_7 = __Pyx_PyInt_From_int(SQLITE_OK); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1058
 * 
 * 
 * cdef _python_to_sqlite(sqlite3_context *context, value):             # <<<<<<<<<<<<<<
 *     # Store a Python value in a sqlite3_context object. For instance, store the
 *     # result to a user-defined function call so it is accessible in SQLite.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("sweepea._python_to_sqlite", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1079
 * 
 * 
 * cdef void _function_callback(sqlite3_context *context, int nparams,             # <<<<<<<<<<<<<<
 *                              sqlite3_value **values) with gil:
 *     # C-callback used by user-defined functions implemented in Python. Note
 */

static void __pyx_f_7sweepea__function_callback(sqlite3_context *__pyx_v_context, int __pyx_v_nparams, sqlite3_value **__pyx_v_values) {
  PyObject *__pyx_v_params = 0;
  PyObject *__pyx_v_fn = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  void *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_function_callback", 0);

  /* "sweepea.pyx":1086
 *     # of the function when it's created.
 *     cdef:
 *         list params = _sqlite_to_python(context, nparams, values)             # <<<<<<<<<<<<<<
 * 
 *     fn = <object>sqlite3_user_data(context)
 */
  __pyx_t_1 = __pyx_f_7sweepea__sqlite_to_python(__pyx_v_context, __pyx_v_nparams, __pyx_v_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 1086, __pyx_L1_error)
  __pyx_v_params = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1088
 *         list params = _sqlite_to_python(context, nparams, values)
 * 
 *     fn = <object>sqlite3_user_data(context)             # <<<<<<<<<<<<<<
 *     _python_to_sqlite(context, fn(*params))
 * 
 */
  __pyx_t_2 = sqlite3_user_data(__pyx_v_context);
  __pyx_t_1 = ((PyObject *)__pyx_t_2);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_fn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1089
 * 
 *     fn = <object>sqlite3_user_data(context)
 *     _python_to_sqlite(context, fn(*params))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PySequence_Tuple(__pyx_v_params); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_fn, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_f_7sweepea__python_to_sqlite(__pyx_v_context, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1079
 * 
 * 
 * cdef void _function_callback(sqlite3_context *context, int nparams,             # <<<<<<<<<<<<<<
 *                              sqlite3_value **values) with gil:
 *     # C-callback used by user-defined functions implemented in Python. Note
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("sweepea._function_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XDECREF(__pyx_v_fn);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "sweepea.pyx":1092
 * 
 * 
 * cdef int _commit_callback(void *userData) with gil:             # <<<<<<<<<<<<<<
 *     # C-callback that delegates to the Python commit handler. If the Python
 *     # function raises a ValueError, then the commit is aborted and the
 */

static int __pyx_f_7sweepea__commit_callback(void *__pyx_v_userData) {
  PyObject *__pyx_v_fn = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_commit_callback", 0);

  /* "sweepea.pyx":1097
 *     # transaction rolled back. Otherwise, regardless of the function return
 *     # value, the transaction will commit.
 *     cdef object fn = <object>userData             # <<<<<<<<<<<<<<
 *     try:
 *         fn()
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_userData);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_fn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1098
 *     # value, the transaction will commit.
 *     cdef object fn = <object>userData
 *     try:             # <<<<<<<<<<<<<<
 *         fn()
 *     except ValueError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

      /* "sweepea.pyx":1099
 *     cdef object fn = <object>userData
 *     try:
 *         fn()             # <<<<<<<<<<<<<<
 *     except ValueError:
 *         return 1
 */
      __Pyx_INCREF(__pyx_v_fn);
      __pyx_t_5 = __pyx_v_fn; __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1099, __pyx_L3_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1099, __pyx_L3_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "sweepea.pyx":1098
 *     # value, the transaction will commit.
 *     cdef object fn = <object>userData
 *     try:             # <<<<<<<<<<<<<<
 *         fn()
 *     except ValueError:
 */
    }

    /* "sweepea.pyx":1103
 *         return 1
 *     else:
 *         return SQLITE_OK             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else:*/ {
      __pyx_r = SQLITE_OK;
      goto __pyx_L6_except_return;
    }
    __pyx_L3_error:;
    __Pyx_PyThreadState_assign
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":1100
 *     try:
 *         fn()
 *     except ValueError:             # <<<<<<<<<<<<<<
 *         return 1
 *     else:
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("sweepea._commit_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_6) < 0) __PYX_ERR(0, 1100, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_6);

      /* "sweepea.pyx":1101
 *         fn()
 *     except ValueError:
 *         return 1             # <<<<<<<<<<<<<<
 *     else:
 *         return SQLITE_OK
 */
      __pyx_r = 1;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L6_except_return;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "sweepea.pyx":1098
 *     # value, the transaction will commit.
 *     cdef object fn = <object>userData
 *     try:             # <<<<<<<<<<<<<<
 *         fn()
 *     except ValueError:
 */
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L6_except_return:;
    __Pyx_PyThreadState_assign
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
    goto __pyx_L0;
  }

  /* "sweepea.pyx":1092
 * 
 * 
 * cdef int _commit_callback(void *userData) with gil:             # <<<<<<<<<<<<<<
 *     # C-callback that delegates to the Python commit handler. If the Python
 *     # function raises a ValueError, then the commit is aborted and the
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("sweepea._commit_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fn);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "sweepea.pyx":1106
 * 
 * 
 * cdef void _rollback_callback(void *userData) with gil:             # <<<<<<<<<<<<<<
 *     # C-callback that delegates to the Python rollback handler.
 *     cdef object fn = <object>userData
 */

static void __pyx_f_7sweepea__rollback_callback(void *__pyx_v_userData) {
  PyObject *__pyx_v_fn = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_rollback_callback", 0);

  /* "sweepea.pyx":1108
 * cdef void _rollback_callback(void *userData) with gil:
 *     # C-callback that delegates to the Python rollback handler.
 *     cdef object fn = <object>userData             # <<<<<<<<<<<<<<
 *     fn()
 * 
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_userData);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_fn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1109
 *     # C-callback that delegates to the Python rollback handler.
 *     cdef object fn = <object>userData
 *     fn()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_INCREF(__pyx_v_fn);
  __pyx_t_2 = __pyx_v_fn; __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __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, 1109, __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;

  /* "sweepea.pyx":1106
 * 
 * 
 * cdef void _rollback_callback(void *userData) with gil:             # <<<<<<<<<<<<<<
 *     # C-callback that delegates to the Python rollback handler.
 *     cdef object fn = <object>userData
 */

  /* 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_WriteUnraisable("sweepea._rollback_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fn);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "sweepea.pyx":1112
 * 
 * 
 * cdef void _update_callback(void *userData, int queryType, char *database,             # <<<<<<<<<<<<<<
 *                             char *table, sqlite3_int64 rowid) with gil:
 *     # C-callback that delegates to a Python function that is executed whenever
 */

static void __pyx_f_7sweepea__update_callback(void *__pyx_v_userData, int __pyx_v_queryType, char *__pyx_v_database, char *__pyx_v_table, sqlite3_int64 __pyx_v_rowid) {
  PyObject *__pyx_v_fn = 0;
  PyObject *__pyx_v_query = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_update_callback", 0);

  /* "sweepea.pyx":1119
 *     # database, the name of the table being updated, and the rowid of the row
 *     # being updatd.
 *     cdef object fn = <object>userData             # <<<<<<<<<<<<<<
 *     if queryType == SQLITE_INSERT:
 *         query = 'INSERT'
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_userData);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_fn = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1120
 *     # being updatd.
 *     cdef object fn = <object>userData
 *     if queryType == SQLITE_INSERT:             # <<<<<<<<<<<<<<
 *         query = 'INSERT'
 *     elif queryType == SQLITE_UPDATE:
 */
  __pyx_t_2 = ((__pyx_v_queryType == SQLITE_INSERT) != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1121
 *     cdef object fn = <object>userData
 *     if queryType == SQLITE_INSERT:
 *         query = 'INSERT'             # <<<<<<<<<<<<<<
 *     elif queryType == SQLITE_UPDATE:
 *         query = 'UPDATE'
 */
    __Pyx_INCREF(__pyx_n_s_INSERT);
    __pyx_v_query = __pyx_n_s_INSERT;

    /* "sweepea.pyx":1120
 *     # being updatd.
 *     cdef object fn = <object>userData
 *     if queryType == SQLITE_INSERT:             # <<<<<<<<<<<<<<
 *         query = 'INSERT'
 *     elif queryType == SQLITE_UPDATE:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1122
 *     if queryType == SQLITE_INSERT:
 *         query = 'INSERT'
 *     elif queryType == SQLITE_UPDATE:             # <<<<<<<<<<<<<<
 *         query = 'UPDATE'
 *     elif queryType == SQLITE_DELETE:
 */
  __pyx_t_2 = ((__pyx_v_queryType == SQLITE_UPDATE) != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1123
 *         query = 'INSERT'
 *     elif queryType == SQLITE_UPDATE:
 *         query = 'UPDATE'             # <<<<<<<<<<<<<<
 *     elif queryType == SQLITE_DELETE:
 *         query = 'DELETE'
 */
    __Pyx_INCREF(__pyx_n_s_UPDATE);
    __pyx_v_query = __pyx_n_s_UPDATE;

    /* "sweepea.pyx":1122
 *     if queryType == SQLITE_INSERT:
 *         query = 'INSERT'
 *     elif queryType == SQLITE_UPDATE:             # <<<<<<<<<<<<<<
 *         query = 'UPDATE'
 *     elif queryType == SQLITE_DELETE:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1124
 *     elif queryType == SQLITE_UPDATE:
 *         query = 'UPDATE'
 *     elif queryType == SQLITE_DELETE:             # <<<<<<<<<<<<<<
 *         query = 'DELETE'
 *     else:
 */
  __pyx_t_2 = ((__pyx_v_queryType == SQLITE_DELETE) != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1125
 *         query = 'UPDATE'
 *     elif queryType == SQLITE_DELETE:
 *         query = 'DELETE'             # <<<<<<<<<<<<<<
 *     else:
 *         query = ''
 */
    __Pyx_INCREF(__pyx_n_s_DELETE);
    __pyx_v_query = __pyx_n_s_DELETE;

    /* "sweepea.pyx":1124
 *     elif queryType == SQLITE_UPDATE:
 *         query = 'UPDATE'
 *     elif queryType == SQLITE_DELETE:             # <<<<<<<<<<<<<<
 *         query = 'DELETE'
 *     else:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1127
 *         query = 'DELETE'
 *     else:
 *         query = ''             # <<<<<<<<<<<<<<
 *     fn(query, str(database), str(table), <int>rowid)
 * 
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_kp_s__23);
    __pyx_v_query = __pyx_kp_s__23;
  }
  __pyx_L3:;

  /* "sweepea.pyx":1128
 *     else:
 *         query = ''
 *     fn(query, str(database), str(table), <int>rowid)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_database); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1128, __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(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_table); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyInt_From_int(((int)__pyx_v_rowid)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_fn);
  __pyx_t_6 = __pyx_v_fn; __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_8 = 1;
    }
  }
  __pyx_t_9 = PyTuple_New(4+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  if (__pyx_t_7) {
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
  }
  __Pyx_INCREF(__pyx_v_query);
  __Pyx_GIVEREF(__pyx_v_query);
  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_query);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_9, 3+__pyx_t_8, __pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1128, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1112
 * 
 * 
 * cdef void _update_callback(void *userData, int queryType, char *database,             # <<<<<<<<<<<<<<
 *                             char *table, sqlite3_int64 rowid) with gil:
 *     # C-callback that delegates to a Python function that is executed whenever
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_WriteUnraisable("sweepea._update_callback", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fn);
  __Pyx_XDECREF(__pyx_v_query);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "sweepea.pyx":1135
 *     Thread-local storage for connection state and transaction management.
 *     """
 *     def __init__(self, **kwargs):             # <<<<<<<<<<<<<<
 *         super(ConnectionLocal, self).__init__(**kwargs)
 *         self.closed = True
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_15ConnectionLocal_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_15ConnectionLocal_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_15ConnectionLocal_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_15ConnectionLocal_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,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) {
        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;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1135, __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__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1135, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("sweepea.ConnectionLocal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_15ConnectionLocal___init__(__pyx_self, __pyx_v_self, __pyx_v_kwargs);

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

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

  /* "sweepea.pyx":1136
 *     """
 *     def __init__(self, **kwargs):
 *         super(ConnectionLocal, self).__init__(**kwargs)             # <<<<<<<<<<<<<<
 *         self.closed = True
 *         self.conn = None
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ConnectionLocal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __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_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1136, __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;

  /* "sweepea.pyx":1137
 *     def __init__(self, **kwargs):
 *         super(ConnectionLocal, self).__init__(**kwargs)
 *         self.closed = True             # <<<<<<<<<<<<<<
 *         self.conn = None
 *         self.transactions = []
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_closed, Py_True) < 0) __PYX_ERR(0, 1137, __pyx_L1_error)

  /* "sweepea.pyx":1138
 *         super(ConnectionLocal, self).__init__(**kwargs)
 *         self.closed = True
 *         self.conn = None             # <<<<<<<<<<<<<<
 *         self.transactions = []
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_conn, Py_None) < 0) __PYX_ERR(0, 1138, __pyx_L1_error)

  /* "sweepea.pyx":1139
 *         self.closed = True
 *         self.conn = None
 *         self.transactions = []             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_transactions, __pyx_t_1) < 0) __PYX_ERR(0, 1139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1135
 *     Thread-local storage for connection state and transaction management.
 *     """
 *     def __init__(self, **kwargs):             # <<<<<<<<<<<<<<
 *         super(ConnectionLocal, self).__init__(**kwargs)
 *         self.closed = True
 */

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

/* "sweepea.pyx":1168
 *         readonly object _local
 * 
 *     def __init__(self, database, pragmas=None, journal_mode=None,             # <<<<<<<<<<<<<<
 *                  rank_functions=False, regex_function=True,
 *                  hash_functions=True, **kwargs):
 */

/* Python wrapper */
static int __pyx_pw_7sweepea_8Database_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7sweepea_8Database_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_database = 0;
  PyObject *__pyx_v_pragmas = 0;
  PyObject *__pyx_v_journal_mode = 0;
  PyObject *__pyx_v_rank_functions = 0;
  PyObject *__pyx_v_regex_function = 0;
  PyObject *__pyx_v_hash_functions = 0;
  PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_database,&__pyx_n_s_pragmas,&__pyx_n_s_journal_mode,&__pyx_n_s_rank_functions,&__pyx_n_s_regex_function,&__pyx_n_s_hash_functions,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);

    /* "sweepea.pyx":1169
 * 
 *     def __init__(self, database, pragmas=None, journal_mode=None,
 *                  rank_functions=False, regex_function=True,             # <<<<<<<<<<<<<<
 *                  hash_functions=True, **kwargs):
 *         self.database = database
 */
    values[3] = ((PyObject *)Py_False);
    values[4] = ((PyObject *)Py_True);

    /* "sweepea.pyx":1170
 *     def __init__(self, database, pragmas=None, journal_mode=None,
 *                  rank_functions=False, regex_function=True,
 *                  hash_functions=True, **kwargs):             # <<<<<<<<<<<<<<
 *         self.database = database
 *         self.connect_kwargs = {}
 */
    values[5] = ((PyObject *)Py_True);
    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_database)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pragmas);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_journal_mode);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rank_functions);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_regex_function);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hash_functions);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1168, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_database = values[0];
    __pyx_v_pragmas = values[1];
    __pyx_v_journal_mode = values[2];
    __pyx_v_rank_functions = values[3];
    __pyx_v_regex_function = values[4];
    __pyx_v_hash_functions = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1168, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("sweepea.Database.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database___init__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_database, __pyx_v_pragmas, __pyx_v_journal_mode, __pyx_v_rank_functions, __pyx_v_regex_function, __pyx_v_hash_functions, __pyx_v_kwargs);

  /* "sweepea.pyx":1168
 *         readonly object _local
 * 
 *     def __init__(self, database, pragmas=None, journal_mode=None,             # <<<<<<<<<<<<<<
 *                  rank_functions=False, regex_function=True,
 *                  hash_functions=True, **kwargs):
 */

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

static int __pyx_pf_7sweepea_8Database___init__(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_database, PyObject *__pyx_v_pragmas, PyObject *__pyx_v_journal_mode, PyObject *__pyx_v_rank_functions, PyObject *__pyx_v_regex_function, PyObject *__pyx_v_hash_functions, PyObject *__pyx_v_kwargs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":1171
 *                  rank_functions=False, regex_function=True,
 *                  hash_functions=True, **kwargs):
 *         self.database = database             # <<<<<<<<<<<<<<
 *         self.connect_kwargs = {}
 *         self._local = ConnectionLocal()
 */
  __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;

  /* "sweepea.pyx":1172
 *                  hash_functions=True, **kwargs):
 *         self.database = database
 *         self.connect_kwargs = {}             # <<<<<<<<<<<<<<
 *         self._local = ConnectionLocal()
 *         self._lock = threading.Lock()
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->connect_kwargs);
  __Pyx_DECREF(__pyx_v_self->connect_kwargs);
  __pyx_v_self->connect_kwargs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1173
 *         self.database = database
 *         self.connect_kwargs = {}
 *         self._local = ConnectionLocal()             # <<<<<<<<<<<<<<
 *         self._lock = threading.Lock()
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ConnectionLocal); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __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, 1173, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_local);
  __Pyx_DECREF(__pyx_v_self->_local);
  __pyx_v_self->_local = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1174
 *         self.connect_kwargs = {}
 *         self._local = ConnectionLocal()
 *         self._lock = threading.Lock()             # <<<<<<<<<<<<<<
 * 
 *         # Registers for user-defined extensions.
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1174, __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, 1174, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_lock);
  __Pyx_DECREF(__pyx_v_self->_lock);
  __pyx_v_self->_lock = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1177
 * 
 *         # Registers for user-defined extensions.
 *         self._aggregates = {}             # <<<<<<<<<<<<<<
 *         self._collations = {}
 *         self._functions = {}
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_aggregates);
  __Pyx_DECREF(__pyx_v_self->_aggregates);
  __pyx_v_self->_aggregates = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1178
 *         # Registers for user-defined extensions.
 *         self._aggregates = {}
 *         self._collations = {}             # <<<<<<<<<<<<<<
 *         self._functions = {}
 *         self._table_functions = []
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_collations);
  __Pyx_DECREF(__pyx_v_self->_collations);
  __pyx_v_self->_collations = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1179
 *         self._aggregates = {}
 *         self._collations = {}
 *         self._functions = {}             # <<<<<<<<<<<<<<
 *         self._table_functions = []
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_functions);
  __Pyx_DECREF(__pyx_v_self->_functions);
  __pyx_v_self->_functions = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1180
 *         self._collations = {}
 *         self._functions = {}
 *         self._table_functions = []             # <<<<<<<<<<<<<<
 * 
 *         # Internal function pinboard used to keep references to user-defined
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_table_functions);
  __Pyx_DECREF(__pyx_v_self->_table_functions);
  __pyx_v_self->_table_functions = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1185
 *         # functions (as opposed to _functions, which holds function *and*
 *         # metadata).
 *         self._function_map = {}             # <<<<<<<<<<<<<<
 * 
 *         kwargs.setdefault('detect_types', pysqlite.PARSE_DECLTYPES)
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_function_map);
  __Pyx_DECREF(__pyx_v_self->_function_map);
  __pyx_v_self->_function_map = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1187
 *         self._function_map = {}
 * 
 *         kwargs.setdefault('detect_types', pysqlite.PARSE_DECLTYPES)             # <<<<<<<<<<<<<<
 *         self.init(database, **kwargs)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pysqlite); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_PARSE_DECLTYPES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_SetDefault(__pyx_v_kwargs, __pyx_n_s_detect_types, __pyx_t_3, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1188
 * 
 *         kwargs.setdefault('detect_types', pysqlite.PARSE_DECLTYPES)
 *         self.init(database, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *         self._pragmas = pragmas or []
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_database);
  __Pyx_GIVEREF(__pyx_v_database);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_database);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":1190
 *         self.init(database, **kwargs)
 * 
 *         self._pragmas = pragmas or []             # <<<<<<<<<<<<<<
 *         if journal_mode is not None:
 *             self._pragmas.append(('journal_mode', journal_mode))
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_pragmas); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1190, __pyx_L1_error)
  if (!__pyx_t_4) {
  } else {
    if (!(likely(PyList_CheckExact(__pyx_v_pragmas))||((__pyx_v_pragmas) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_pragmas)->tp_name), 0))) __PYX_ERR(0, 1190, __pyx_L1_error)
    __Pyx_INCREF(__pyx_v_pragmas);
    __pyx_t_2 = __pyx_v_pragmas;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_2 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->_pragmas);
  __Pyx_DECREF(__pyx_v_self->_pragmas);
  __pyx_v_self->_pragmas = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "sweepea.pyx":1191
 * 
 *         self._pragmas = pragmas or []
 *         if journal_mode is not None:             # <<<<<<<<<<<<<<
 *             self._pragmas.append(('journal_mode', journal_mode))
 * 
 */
  __pyx_t_4 = (__pyx_v_journal_mode != Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "sweepea.pyx":1192
 *         self._pragmas = pragmas or []
 *         if journal_mode is not None:
 *             self._pragmas.append(('journal_mode', journal_mode))             # <<<<<<<<<<<<<<
 * 
 *         # Register built-in custom functions.
 */
    if (unlikely(__pyx_v_self->_pragmas == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
      __PYX_ERR(0, 1192, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_journal_mode);
    __Pyx_GIVEREF(__pyx_n_s_journal_mode);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_journal_mode);
    __Pyx_INCREF(__pyx_v_journal_mode);
    __Pyx_GIVEREF(__pyx_v_journal_mode);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_journal_mode);
    __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->_pragmas, __pyx_t_2); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1192, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1191
 * 
 *         self._pragmas = pragmas or []
 *         if journal_mode is not None:             # <<<<<<<<<<<<<<
 *             self._pragmas.append(('journal_mode', journal_mode))
 * 
 */
  }

  /* "sweepea.pyx":1195
 * 
 *         # Register built-in custom functions.
 *         if rank_functions:             # <<<<<<<<<<<<<<
 *             self.func('rank')(rank)
 *             self.func('bm25')(bm25)
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_rank_functions); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1195, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "sweepea.pyx":1196
 *         # Register built-in custom functions.
 *         if rank_functions:
 *             self.func('rank')(rank)             # <<<<<<<<<<<<<<
 *             self.func('bm25')(bm25)
 *         if regex_function:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_CFunc_float____object___to_py(__pyx_f_7sweepea_rank); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1196, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1196, __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_3);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1196, __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;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1197
 *         if rank_functions:
 *             self.func('rank')(rank)
 *             self.func('bm25')(bm25)             # <<<<<<<<<<<<<<
 *         if regex_function:
 *             self.func('regexp')(regexp)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_CFunc_float____object____int____float____float___to_py(__pyx_f_7sweepea_bm25); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1197, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __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;

    /* "sweepea.pyx":1195
 * 
 *         # Register built-in custom functions.
 *         if rank_functions:             # <<<<<<<<<<<<<<
 *             self.func('rank')(rank)
 *             self.func('bm25')(bm25)
 */
  }

  /* "sweepea.pyx":1198
 *             self.func('rank')(rank)
 *             self.func('bm25')(bm25)
 *         if regex_function:             # <<<<<<<<<<<<<<
 *             self.func('regexp')(regexp)
 *         if hash_functions:
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_regex_function); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1198, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "sweepea.pyx":1199
 *             self.func('bm25')(bm25)
 *         if regex_function:
 *             self.func('regexp')(regexp)             # <<<<<<<<<<<<<<
 *         if hash_functions:
 *             self.func('murmurhash')(murmurhash)
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_func); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_CFunc_bint____basestring____basestring___to_py(__pyx_f_7sweepea_regexp); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1199, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1198
 *             self.func('rank')(rank)
 *             self.func('bm25')(bm25)
 *         if regex_function:             # <<<<<<<<<<<<<<
 *             self.func('regexp')(regexp)
 *         if hash_functions:
 */
  }

  /* "sweepea.pyx":1200
 *         if regex_function:
 *             self.func('regexp')(regexp)
 *         if hash_functions:             # <<<<<<<<<<<<<<
 *             self.func('murmurhash')(murmurhash)
 *             self.func('md5')(hash_md5)
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_hash_functions); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1200, __pyx_L1_error)
  if (__pyx_t_5) {

    /* "sweepea.pyx":1201
 *             self.func('regexp')(regexp)
 *         if hash_functions:
 *             self.func('murmurhash')(murmurhash)             # <<<<<<<<<<<<<<
 *             self.func('md5')(hash_md5)
 *             self.func('sha1')(hash_sha1)
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_func); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_murmurhash); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_8); __pyx_t_8 = NULL;
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1201, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1202
 *         if hash_functions:
 *             self.func('murmurhash')(murmurhash)
 *             self.func('md5')(hash_md5)             # <<<<<<<<<<<<<<
 *             self.func('sha1')(hash_sha1)
 *             self.func('sha256')(hash_sha256)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_func); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_hash_md5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1202, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1202, __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_3);
      PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1202, __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;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1203
 *             self.func('murmurhash')(murmurhash)
 *             self.func('md5')(hash_md5)
 *             self.func('sha1')(hash_sha1)             # <<<<<<<<<<<<<<
 *             self.func('sha256')(hash_sha256)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_func); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_hash_sha1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1203, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __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;

    /* "sweepea.pyx":1204
 *             self.func('md5')(hash_md5)
 *             self.func('sha1')(hash_sha1)
 *             self.func('sha256')(hash_sha256)             # <<<<<<<<<<<<<<
 * 
 *     def init(self, database, **connect_kwargs):
 */
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_func); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_hash_sha256); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1204, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_t_1 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (!__pyx_t_1) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1204, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
      __Pyx_GIVEREF(__pyx_t_8);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_8);
      __pyx_t_8 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1200
 *         if regex_function:
 *             self.func('regexp')(regexp)
 *         if hash_functions:             # <<<<<<<<<<<<<<
 *             self.func('murmurhash')(murmurhash)
 *             self.func('md5')(hash_md5)
 */
  }

  /* "sweepea.pyx":1168
 *         readonly object _local
 * 
 *     def __init__(self, database, pragmas=None, journal_mode=None,             # <<<<<<<<<<<<<<
 *                  rank_functions=False, regex_function=True,
 *                  hash_functions=True, **kwargs):
 */

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

/* "sweepea.pyx":1206
 *             self.func('sha256')(hash_sha256)
 * 
 *     def init(self, database, **connect_kwargs):             # <<<<<<<<<<<<<<
 *         """Initialize the database with a new name and connection params."""
 *         if not self._local.closed:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_3init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7sweepea_8Database_2init[] = "Initialize the database with a new name and connection params.";
static PyObject *__pyx_pw_7sweepea_8Database_3init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_database = 0;
  PyObject *__pyx_v_connect_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("init (wrapper)", 0);
  __pyx_v_connect_kwargs = PyDict_New(); if (unlikely(!__pyx_v_connect_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_connect_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_database,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) {
        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_database)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_connect_kwargs, values, pos_args, "init") < 0)) __PYX_ERR(0, 1206, __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_database = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("init", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1206, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_connect_kwargs); __pyx_v_connect_kwargs = 0;
  __Pyx_AddTraceback("sweepea.Database.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_2init(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_database, __pyx_v_connect_kwargs);

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

static PyObject *__pyx_pf_7sweepea_8Database_2init(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_database, PyObject *__pyx_v_connect_kwargs) {
  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;
  __Pyx_RefNannySetupContext("init", 0);

  /* "sweepea.pyx":1208
 *     def init(self, database, **connect_kwargs):
 *         """Initialize the database with a new name and connection params."""
 *         if not self._local.closed:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1208, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1208, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "sweepea.pyx":1209
 *         """Initialize the database with a new name and connection params."""
 *         if not self._local.closed:
 *             self.close()             # <<<<<<<<<<<<<<
 * 
 *         self.deferred = database is None
 */
    ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->close(__pyx_v_self, 0);

    /* "sweepea.pyx":1208
 *     def init(self, database, **connect_kwargs):
 *         """Initialize the database with a new name and connection params."""
 *         if not self._local.closed:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  }

  /* "sweepea.pyx":1211
 *             self.close()
 * 
 *         self.deferred = database is None             # <<<<<<<<<<<<<<
 *         self.database = database
 *         self.connect_kwargs.update(connect_kwargs)
 */
  __pyx_t_3 = (__pyx_v_database == Py_None);
  __pyx_v_self->deferred = __pyx_t_3;

  /* "sweepea.pyx":1212
 * 
 *         self.deferred = database is None
 *         self.database = database             # <<<<<<<<<<<<<<
 *         self.connect_kwargs.update(connect_kwargs)
 * 
 */
  __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;

  /* "sweepea.pyx":1213
 *         self.deferred = database is None
 *         self.database = database
 *         self.connect_kwargs.update(connect_kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->connect_kwargs, __pyx_n_s_update); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_connect_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1213, __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_connect_kwargs);
    __Pyx_GIVEREF(__pyx_v_connect_kwargs);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_connect_kwargs);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1206
 *             self.func('sha256')(hash_sha256)
 * 
 *     def init(self, database, **connect_kwargs):             # <<<<<<<<<<<<<<
 *         """Initialize the database with a new name and connection params."""
 *         if not self._local.closed:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("sweepea.Database.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1215
 *         self.connect_kwargs.update(connect_kwargs)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             pysqlite_Connection *conn
 */

/* Python wrapper */
static void __pyx_pw_7sweepea_8Database_5__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_7sweepea_8Database_5__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_7sweepea_8Database_4__dealloc__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static void __pyx_pf_7sweepea_8Database_4__dealloc__(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  pysqlite_Connection *__pyx_v_conn;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "sweepea.pyx":1221
 *         # When deallocating a Database object, we need to ensure that we clear
 *         # any commit, rollback or update hooks that may have been applied.
 *         if self._local and getattr(self._local, 'conn', None) is not None:             # <<<<<<<<<<<<<<
 *             conn = <pysqlite_Connection *>(self._local.conn)
 *             if conn.db:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_local); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1221, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __pyx_v_self->_local;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetAttr3(__pyx_t_3, __pyx_n_s_conn, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = (__pyx_t_4 != Py_None);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "sweepea.pyx":1222
 *         # any commit, rollback or update hooks that may have been applied.
 *         if self._local and getattr(self._local, 'conn', None) is not None:
 *             conn = <pysqlite_Connection *>(self._local.conn)             # <<<<<<<<<<<<<<
 *             if conn.db:
 *                 if self._commit_hook is not None:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_conn); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_v_conn = ((pysqlite_Connection *)__pyx_t_4);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "sweepea.pyx":1223
 *         if self._local and getattr(self._local, 'conn', None) is not None:
 *             conn = <pysqlite_Connection *>(self._local.conn)
 *             if conn.db:             # <<<<<<<<<<<<<<
 *                 if self._commit_hook is not None:
 *                     sqlite3_commit_hook(conn.db, NULL, NULL)
 */
    __pyx_t_1 = (__pyx_v_conn->db != 0);
    if (__pyx_t_1) {

      /* "sweepea.pyx":1224
 *             conn = <pysqlite_Connection *>(self._local.conn)
 *             if conn.db:
 *                 if self._commit_hook is not None:             # <<<<<<<<<<<<<<
 *                     sqlite3_commit_hook(conn.db, NULL, NULL)
 *                 if self._rollback_hook is not None:
 */
      __pyx_t_1 = (__pyx_v_self->_commit_hook != Py_None);
      __pyx_t_5 = (__pyx_t_1 != 0);
      if (__pyx_t_5) {

        /* "sweepea.pyx":1225
 *             if conn.db:
 *                 if self._commit_hook is not None:
 *                     sqlite3_commit_hook(conn.db, NULL, NULL)             # <<<<<<<<<<<<<<
 *                 if self._rollback_hook is not None:
 *                     sqlite3_rollback_hook(conn.db, NULL, NULL)
 */
        sqlite3_commit_hook(__pyx_v_conn->db, NULL, NULL);

        /* "sweepea.pyx":1224
 *             conn = <pysqlite_Connection *>(self._local.conn)
 *             if conn.db:
 *                 if self._commit_hook is not None:             # <<<<<<<<<<<<<<
 *                     sqlite3_commit_hook(conn.db, NULL, NULL)
 *                 if self._rollback_hook is not None:
 */
      }

      /* "sweepea.pyx":1226
 *                 if self._commit_hook is not None:
 *                     sqlite3_commit_hook(conn.db, NULL, NULL)
 *                 if self._rollback_hook is not None:             # <<<<<<<<<<<<<<
 *                     sqlite3_rollback_hook(conn.db, NULL, NULL)
 *                 if self._update_hook is not None:
 */
      __pyx_t_5 = (__pyx_v_self->_rollback_hook != Py_None);
      __pyx_t_1 = (__pyx_t_5 != 0);
      if (__pyx_t_1) {

        /* "sweepea.pyx":1227
 *                     sqlite3_commit_hook(conn.db, NULL, NULL)
 *                 if self._rollback_hook is not None:
 *                     sqlite3_rollback_hook(conn.db, NULL, NULL)             # <<<<<<<<<<<<<<
 *                 if self._update_hook is not None:
 *                     sqlite3_update_hook(conn.db, NULL, NULL)
 */
        sqlite3_rollback_hook(__pyx_v_conn->db, NULL, NULL);

        /* "sweepea.pyx":1226
 *                 if self._commit_hook is not None:
 *                     sqlite3_commit_hook(conn.db, NULL, NULL)
 *                 if self._rollback_hook is not None:             # <<<<<<<<<<<<<<
 *                     sqlite3_rollback_hook(conn.db, NULL, NULL)
 *                 if self._update_hook is not None:
 */
      }

      /* "sweepea.pyx":1228
 *                 if self._rollback_hook is not None:
 *                     sqlite3_rollback_hook(conn.db, NULL, NULL)
 *                 if self._update_hook is not None:             # <<<<<<<<<<<<<<
 *                     sqlite3_update_hook(conn.db, NULL, NULL)
 * 
 */
      __pyx_t_1 = (__pyx_v_self->_update_hook != Py_None);
      __pyx_t_5 = (__pyx_t_1 != 0);
      if (__pyx_t_5) {

        /* "sweepea.pyx":1229
 *                     sqlite3_rollback_hook(conn.db, NULL, NULL)
 *                 if self._update_hook is not None:
 *                     sqlite3_update_hook(conn.db, NULL, NULL)             # <<<<<<<<<<<<<<
 * 
 *     cpdef connect(self):
 */
        sqlite3_update_hook(__pyx_v_conn->db, NULL, NULL);

        /* "sweepea.pyx":1228
 *                 if self._rollback_hook is not None:
 *                     sqlite3_rollback_hook(conn.db, NULL, NULL)
 *                 if self._update_hook is not None:             # <<<<<<<<<<<<<<
 *                     sqlite3_update_hook(conn.db, NULL, NULL)
 * 
 */
      }

      /* "sweepea.pyx":1223
 *         if self._local and getattr(self._local, 'conn', None) is not None:
 *             conn = <pysqlite_Connection *>(self._local.conn)
 *             if conn.db:             # <<<<<<<<<<<<<<
 *                 if self._commit_hook is not None:
 *                     sqlite3_commit_hook(conn.db, NULL, NULL)
 */
    }

    /* "sweepea.pyx":1221
 *         # When deallocating a Database object, we need to ensure that we clear
 *         # any commit, rollback or update hooks that may have been applied.
 *         if self._local and getattr(self._local, 'conn', None) is not None:             # <<<<<<<<<<<<<<
 *             conn = <pysqlite_Connection *>(self._local.conn)
 *             if conn.db:
 */
  }

  /* "sweepea.pyx":1215
 *         self.connect_kwargs.update(connect_kwargs)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             pysqlite_Connection *conn
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("sweepea.Database.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "sweepea.pyx":1231
 *                     sqlite3_update_hook(conn.db, NULL, NULL)
 * 
 *     cpdef connect(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check that connection is closed, then create a new connection to the
 */

static PyObject *__pyx_pw_7sweepea_8Database_7connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7sweepea_8Database_connect(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch) {
  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;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("connect", 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_connect); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_7connect)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1231, __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, 1231, __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;
  }

  /* "sweepea.pyx":1239
 *         the connection was already opened.
 *         """
 *         with self._lock:             # <<<<<<<<<<<<<<
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')
 */
  /*with:*/ {
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->_lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->_lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1239, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L3_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, 1239, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "sweepea.pyx":1240
 *         """
 *         with self._lock:
 *             if self.deferred:             # <<<<<<<<<<<<<<
 *                 raise InterfaceError('Database has not been initialized.')
 *             if not self._local.closed:
 */
          __pyx_t_9 = (__pyx_v_self->deferred != 0);
          if (__pyx_t_9) {

            /* "sweepea.pyx":1241
 *         with self._lock:
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')             # <<<<<<<<<<<<<<
 *             if not self._local.closed:
 *                 raise InterfaceError('Connection already open in this thread.')
 */
            __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1241, __pyx_L7_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, 1241, __pyx_L7_error)

            /* "sweepea.pyx":1240
 *         """
 *         with self._lock:
 *             if self.deferred:             # <<<<<<<<<<<<<<
 *                 raise InterfaceError('Database has not been initialized.')
 *             if not self._local.closed:
 */
          }

          /* "sweepea.pyx":1242
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')
 *             if not self._local.closed:             # <<<<<<<<<<<<<<
 *                 raise InterfaceError('Connection already open in this thread.')
 *             conn = self._local.conn = pysqlite.connect(self.database,
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_closed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1242, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1242, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_10 = ((!__pyx_t_9) != 0);
          if (__pyx_t_10) {

            /* "sweepea.pyx":1243
 *                 raise InterfaceError('Database has not been initialized.')
 *             if not self._local.closed:
 *                 raise InterfaceError('Connection already open in this thread.')             # <<<<<<<<<<<<<<
 *             conn = self._local.conn = pysqlite.connect(self.database,
 *                                                        **self.connect_kwargs)
 */
            __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1243, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1243, __pyx_L7_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, 1243, __pyx_L7_error)

            /* "sweepea.pyx":1242
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')
 *             if not self._local.closed:             # <<<<<<<<<<<<<<
 *                 raise InterfaceError('Connection already open in this thread.')
 *             conn = self._local.conn = pysqlite.connect(self.database,
 */
          }

          /* "sweepea.pyx":1244
 *             if not self._local.closed:
 *                 raise InterfaceError('Connection already open in this thread.')
 *             conn = self._local.conn = pysqlite.connect(self.database,             # <<<<<<<<<<<<<<
 *                                                        **self.connect_kwargs)
 *             self._local.closed = False
 */
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pysqlite); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_connect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1244, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_INCREF(__pyx_v_self->database);
          __Pyx_GIVEREF(__pyx_v_self->database);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->database);

          /* "sweepea.pyx":1245
 *                 raise InterfaceError('Connection already open in this thread.')
 *             conn = self._local.conn = pysqlite.connect(self.database,
 *                                                        **self.connect_kwargs)             # <<<<<<<<<<<<<<
 *             self._local.closed = False
 *             self.initialize_connection(conn)
 */
          if (unlikely(__pyx_v_self->connect_kwargs == Py_None)) {
            PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
            __PYX_ERR(0, 1245, __pyx_L7_error)
          }

          /* "sweepea.pyx":1244
 *             if not self._local.closed:
 *                 raise InterfaceError('Connection already open in this thread.')
 *             conn = self._local.conn = pysqlite.connect(self.database,             # <<<<<<<<<<<<<<
 *                                                        **self.connect_kwargs)
 *             self._local.closed = False
 */
          __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_v_self->connect_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1244, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_INCREF(__pyx_t_3);
          __pyx_v_conn = __pyx_t_3;
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->_local, __pyx_n_s_conn, __pyx_t_3) < 0) __PYX_ERR(0, 1244, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "sweepea.pyx":1246
 *             conn = self._local.conn = pysqlite.connect(self.database,
 *                                                        **self.connect_kwargs)
 *             self._local.closed = False             # <<<<<<<<<<<<<<
 *             self.initialize_connection(conn)
 * 
 */
          if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->_local, __pyx_n_s_closed, Py_False) < 0) __PYX_ERR(0, 1246, __pyx_L7_error)

          /* "sweepea.pyx":1247
 *                                                        **self.connect_kwargs)
 *             self._local.closed = False
 *             self.initialize_connection(conn)             # <<<<<<<<<<<<<<
 * 
 *         return True
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_initialize_connection); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1247, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_2 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
            __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
            if (likely(__pyx_t_2)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
              __Pyx_INCREF(__pyx_t_2);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_1, function);
            }
          }
          if (!__pyx_t_2) {
            __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_conn); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1247, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
          } else {
            __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1247, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
            __Pyx_INCREF(__pyx_v_conn);
            __Pyx_GIVEREF(__pyx_v_conn);
            PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_conn);
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1247, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "sweepea.pyx":1239
 *         the connection was already opened.
 *         """
 *         with self._lock:             # <<<<<<<<<<<<<<
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')
 */
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("sweepea.Database.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 1239, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_2 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1239, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1239, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_10 < 0) __PYX_ERR(0, 1239, __pyx_L9_except_error)
          __pyx_t_9 = ((!(__pyx_t_10 != 0)) != 0);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_4);
            __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4);
            __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; 
            __PYX_ERR(0, 1239, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_5) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__33, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1239, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L20;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L1_error;
    __pyx_L20:;
  }

  /* "sweepea.pyx":1249
 *             self.initialize_connection(conn)
 * 
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint close(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "sweepea.pyx":1231
 *                     sqlite3_update_hook(conn.db, NULL, NULL)
 * 
 *     cpdef connect(self):             # <<<<<<<<<<<<<<
 *         """
 *         Check that connection is closed, then create a new connection to the
 */

  /* 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("sweepea.Database.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_conn);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_7connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7sweepea_8Database_6connect[] = "\n        Check that connection is closed, then create a new connection to the\n        given pysqlite database.\n\n        Raises an InterfaceError if the database hasn't been initialized or if\n        the connection was already opened.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_7connect(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("connect (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_6connect(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_6connect(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("connect", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_8Database_connect(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1231, __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("sweepea.Database.connect", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1251
 *         return True
 * 
 *     cpdef bint close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close the currently-open connection for the calling thread.
 */

static PyObject *__pyx_pw_7sweepea_8Database_9close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static int __pyx_f_7sweepea_8Database_close(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __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;
  PyObject *__pyx_t_11 = NULL;
  __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, 1251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_9close)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1251, __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, 1251, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1251, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_5;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "sweepea.pyx":1258
 *         the database is already closed, this is a no-op.
 *         """
 *         with self._lock:             # <<<<<<<<<<<<<<
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')
 */
  /*with:*/ {
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->_lock, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __Pyx_PyObject_LookupSpecial(__pyx_v_self->_lock, __pyx_n_s_enter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1258, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L3_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, 1258, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "sweepea.pyx":1259
 *         """
 *         with self._lock:
 *             if self.deferred:             # <<<<<<<<<<<<<<
 *                 raise InterfaceError('Database has not been initialized.')
 *             if not self._local.closed:
 */
          __pyx_t_5 = (__pyx_v_self->deferred != 0);
          if (__pyx_t_5) {

            /* "sweepea.pyx":1260
 *         with self._lock:
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')             # <<<<<<<<<<<<<<
 *             if not self._local.closed:
 *                 self._local.conn.close()
 */
            __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1260, __pyx_L7_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, 1260, __pyx_L7_error)

            /* "sweepea.pyx":1259
 *         """
 *         with self._lock:
 *             if self.deferred:             # <<<<<<<<<<<<<<
 *                 raise InterfaceError('Database has not been initialized.')
 *             if not self._local.closed:
 */
          }

          /* "sweepea.pyx":1261
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')
 *             if not self._local.closed:             # <<<<<<<<<<<<<<
 *                 self._local.conn.close()
 *                 self._local.closed = True
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_closed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1261, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1261, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_10 = ((!__pyx_t_5) != 0);
          if (__pyx_t_10) {

            /* "sweepea.pyx":1262
 *                 raise InterfaceError('Database has not been initialized.')
 *             if not self._local.closed:
 *                 self._local.conn.close()             # <<<<<<<<<<<<<<
 *                 self._local.closed = True
 *                 self._local.transactions = []
 */
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_conn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1262, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1262, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_1)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            if (__pyx_t_1) {
              __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1262, __pyx_L7_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, 1262, __pyx_L7_error)
            }
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "sweepea.pyx":1263
 *             if not self._local.closed:
 *                 self._local.conn.close()
 *                 self._local.closed = True             # <<<<<<<<<<<<<<
 *                 self._local.transactions = []
 *                 return True
 */
            if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->_local, __pyx_n_s_closed, Py_True) < 0) __PYX_ERR(0, 1263, __pyx_L7_error)

            /* "sweepea.pyx":1264
 *                 self._local.conn.close()
 *                 self._local.closed = True
 *                 self._local.transactions = []             # <<<<<<<<<<<<<<
 *                 return True
 *             return False
 */
            __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1264, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            if (__Pyx_PyObject_SetAttrStr(__pyx_v_self->_local, __pyx_n_s_transactions, __pyx_t_2) < 0) __PYX_ERR(0, 1264, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

            /* "sweepea.pyx":1265
 *                 self._local.closed = True
 *                 self._local.transactions = []
 *                 return True             # <<<<<<<<<<<<<<
 *             return False
 * 
 */
            __pyx_r = 1;
            goto __pyx_L11_try_return;

            /* "sweepea.pyx":1261
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')
 *             if not self._local.closed:             # <<<<<<<<<<<<<<
 *                 self._local.conn.close()
 *                 self._local.closed = True
 */
          }

          /* "sweepea.pyx":1266
 *                 self._local.transactions = []
 *                 return True
 *             return False             # <<<<<<<<<<<<<<
 * 
 *     def initialize_connection(self, conn):
 */
          __pyx_r = 0;
          goto __pyx_L11_try_return;

          /* "sweepea.pyx":1258
 *         the database is already closed, this is a no-op.
 *         """
 *         with self._lock:             # <<<<<<<<<<<<<<
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')
 */
        }
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("sweepea.Database.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_3, &__pyx_t_1) < 0) __PYX_ERR(0, 1258, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1258, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1258, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_10 < 0) __PYX_ERR(0, 1258, __pyx_L9_except_error)
          __pyx_t_5 = ((!(__pyx_t_10 != 0)) != 0);
          if (__pyx_t_5) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_3, __pyx_t_1);
            __pyx_t_2 = 0; __pyx_t_3 = 0; __pyx_t_1 = 0; 
            __PYX_ERR(0, 1258, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L11_try_return:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L4_return;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__35, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1258, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L4_return: {
        __pyx_t_5 = __pyx_r;
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__36, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1258, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __pyx_r = __pyx_t_5;
        goto __pyx_L0;
      }
      __pyx_L6:;
    }
    goto __pyx_L20;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L20:;
  }

  /* "sweepea.pyx":1251
 *         return True
 * 
 *     cpdef bint close(self):             # <<<<<<<<<<<<<<
 *         """
 *         Close the currently-open connection for the calling thread.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("sweepea.Database.close", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_9close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7sweepea_8Database_8close[] = "\n        Close the currently-open connection for the calling thread.\n\n        Raises an InterfaceError if the database hasn't been initialized. If\n        the database is already closed, this is a no-op.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_9close(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("close (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_8close(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_8close(struct __pyx_obj_7sweepea_Database *__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_PyBool_FromLong(__pyx_f_7sweepea_8Database_close(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1251, __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("sweepea.Database.close", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1268
 *             return False
 * 
 *     def initialize_connection(self, conn):             # <<<<<<<<<<<<<<
 *         """
 *         Initialize the connection by setting per-connection-state, registering
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_11initialize_connection(PyObject *__pyx_v_self, PyObject *__pyx_v_conn); /*proto*/
static char __pyx_doc_7sweepea_8Database_10initialize_connection[] = "\n        Initialize the connection by setting per-connection-state, registering\n        user-defined extensions, and configuring any hooks.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_11initialize_connection(PyObject *__pyx_v_self, PyObject *__pyx_v_conn) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("initialize_connection (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_10initialize_connection(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_conn));

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

static PyObject *__pyx_pf_7sweepea_8Database_10initialize_connection(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_conn) {
  PyObject *__pyx_v_cursor = NULL;
  PyObject *__pyx_v_pragma = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_klass = NULL;
  PyObject *__pyx_v_fn = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_deterministic = NULL;
  PyObject *__pyx_v_table_function = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  __Pyx_RefNannySetupContext("initialize_connection", 0);

  /* "sweepea.pyx":1273
 *         user-defined extensions, and configuring any hooks.
 *         """
 *         conn.isolation_level = None  # Disable transaction state-machine.             # <<<<<<<<<<<<<<
 * 
 *         if self._pragmas:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_conn, __pyx_n_s_isolation_level, Py_None) < 0) __PYX_ERR(0, 1273, __pyx_L1_error)

  /* "sweepea.pyx":1275
 *         conn.isolation_level = None  # Disable transaction state-machine.
 * 
 *         if self._pragmas:             # <<<<<<<<<<<<<<
 *             cursor = conn.cursor()
 *             for pragma, value in self._pragmas:
 */
  __pyx_t_1 = (__pyx_v_self->_pragmas != Py_None) && (PyList_GET_SIZE(__pyx_v_self->_pragmas) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":1276
 * 
 *         if self._pragmas:
 *             cursor = conn.cursor()             # <<<<<<<<<<<<<<
 *             for pragma, value in self._pragmas:
 *                 cursor.execute('PRAGMA %s = %s;' % (pragma, value))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_cursor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1276, __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, 1276, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_cursor = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "sweepea.pyx":1277
 *         if self._pragmas:
 *             cursor = conn.cursor()
 *             for pragma, value in self._pragmas:             # <<<<<<<<<<<<<<
 *                 cursor.execute('PRAGMA %s = %s;' % (pragma, value))
 *             cursor.close()
 */
    if (unlikely(__pyx_v_self->_pragmas == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 1277, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_self->_pragmas; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1277, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1277, __pyx_L1_error)
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        #else
        __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1277, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1277, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1277, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
        index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1277, __pyx_L1_error)
        __pyx_t_8 = NULL;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L7_unpacking_done;
        __pyx_L6_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1277, __pyx_L1_error)
        __pyx_L7_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_pragma, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "sweepea.pyx":1278
 *             cursor = conn.cursor()
 *             for pragma, value in self._pragmas:
 *                 cursor.execute('PRAGMA %s = %s;' % (pragma, value))             # <<<<<<<<<<<<<<
 *             cursor.close()
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_cursor, __pyx_n_s_execute); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_pragma);
      __Pyx_GIVEREF(__pyx_v_pragma);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_pragma);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_value);
      __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_PRAGMA_s_s, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1278, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1278, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1278, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1278, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "sweepea.pyx":1277
 *         if self._pragmas:
 *             cursor = conn.cursor()
 *             for pragma, value in self._pragmas:             # <<<<<<<<<<<<<<
 *                 cursor.execute('PRAGMA %s = %s;' % (pragma, value))
 *             cursor.close()
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1279
 *             for pragma, value in self._pragmas:
 *                 cursor.execute('PRAGMA %s = %s;' % (pragma, value))
 *             cursor.close()             # <<<<<<<<<<<<<<
 * 
 *         if self._aggregates:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cursor, __pyx_n_s_close); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __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;

    /* "sweepea.pyx":1275
 *         conn.isolation_level = None  # Disable transaction state-machine.
 * 
 *         if self._pragmas:             # <<<<<<<<<<<<<<
 *             cursor = conn.cursor()
 *             for pragma, value in self._pragmas:
 */
  }

  /* "sweepea.pyx":1281
 *             cursor.close()
 * 
 *         if self._aggregates:             # <<<<<<<<<<<<<<
 *             for name, klass in self._aggregates.items():
 *                 self._create_aggregate(conn, klass, name)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_aggregates); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1281, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "sweepea.pyx":1282
 * 
 *         if self._aggregates:
 *             for name, klass in self._aggregates.items():             # <<<<<<<<<<<<<<
 *                 self._create_aggregate(conn, klass, name)
 * 
 */
    if (unlikely(__pyx_v_self->_aggregates == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
      __PYX_ERR(0, 1282, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyDict_Items(__pyx_v_self->_aggregates); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1282, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1282, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1282, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1282, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_10(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1282, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
        PyObject* sequence = __pyx_t_2;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1282, __pyx_L1_error)
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_9);
        #else
        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1282, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1282, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1282, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
        index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_9 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_9)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 1282, __pyx_L1_error)
        __pyx_t_8 = NULL;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L12_unpacking_done;
        __pyx_L11_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1282, __pyx_L1_error)
        __pyx_L12_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_klass, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "sweepea.pyx":1283
 *         if self._aggregates:
 *             for name, klass in self._aggregates.items():
 *                 self._create_aggregate(conn, klass, name)             # <<<<<<<<<<<<<<
 * 
 *         if self._collations:
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_create_aggregate); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_6 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_7 = PyTuple_New(3+__pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_v_conn);
      __Pyx_GIVEREF(__pyx_v_conn);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_11, __pyx_v_conn);
      __Pyx_INCREF(__pyx_v_klass);
      __Pyx_GIVEREF(__pyx_v_klass);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_11, __pyx_v_klass);
      __Pyx_INCREF(__pyx_v_name);
      __Pyx_GIVEREF(__pyx_v_name);
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_11, __pyx_v_name);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "sweepea.pyx":1282
 * 
 *         if self._aggregates:
 *             for name, klass in self._aggregates.items():             # <<<<<<<<<<<<<<
 *                 self._create_aggregate(conn, klass, name)
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "sweepea.pyx":1281
 *             cursor.close()
 * 
 *         if self._aggregates:             # <<<<<<<<<<<<<<
 *             for name, klass in self._aggregates.items():
 *                 self._create_aggregate(conn, klass, name)
 */
  }

  /* "sweepea.pyx":1285
 *                 self._create_aggregate(conn, klass, name)
 * 
 *         if self._collations:             # <<<<<<<<<<<<<<
 *             for name, fn in self._collations.items():
 *                 self._create_collation(conn, fn, name)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_collations); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1285, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "sweepea.pyx":1286
 * 
 *         if self._collations:
 *             for name, fn in self._collations.items():             # <<<<<<<<<<<<<<
 *                 self._create_collation(conn, fn, name)
 * 
 */
    if (unlikely(__pyx_v_self->_collations == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
      __PYX_ERR(0, 1286, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyDict_Items(__pyx_v_self->_collations); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1286, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_10 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1286, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1286, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1286, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1286, __pyx_L1_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1286, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_10(__pyx_t_2);
        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, 1286, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1286, __pyx_L1_error)
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_9 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_7);
        #else
        __pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1286, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1286, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1286, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext;
        index = 0; __pyx_t_9 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L16_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        index = 1; __pyx_t_7 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L16_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1286, __pyx_L1_error)
        __pyx_t_8 = NULL;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L17_unpacking_done;
        __pyx_L16_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_8 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1286, __pyx_L1_error)
        __pyx_L17_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_fn, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "sweepea.pyx":1287
 *         if self._collations:
 *             for name, fn in self._collations.items():
 *                 self._create_collation(conn, fn, name)             # <<<<<<<<<<<<<<
 * 
 *         if self._functions:
 */
      __pyx_t_3 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->_create_collation(__pyx_v_self, __pyx_v_conn, __pyx_v_fn, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "sweepea.pyx":1286
 * 
 *         if self._collations:
 *             for name, fn in self._collations.items():             # <<<<<<<<<<<<<<
 *                 self._create_collation(conn, fn, name)
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1285
 *                 self._create_aggregate(conn, klass, name)
 * 
 *         if self._collations:             # <<<<<<<<<<<<<<
 *             for name, fn in self._collations.items():
 *                 self._create_collation(conn, fn, name)
 */
  }

  /* "sweepea.pyx":1289
 *                 self._create_collation(conn, fn, name)
 * 
 *         if self._functions:             # <<<<<<<<<<<<<<
 *             for name, (fn, n, deterministic) in self._functions.items():
 *                 self._create_function(conn, fn, name, n, deterministic)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->_functions); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1289, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "sweepea.pyx":1290
 * 
 *         if self._functions:
 *             for name, (fn, n, deterministic) in self._functions.items():             # <<<<<<<<<<<<<<
 *                 self._create_function(conn, fn, name, n, deterministic)
 * 
 */
    if (unlikely(__pyx_v_self->_functions == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "items");
      __PYX_ERR(0, 1290, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyDict_Items(__pyx_v_self->_functions); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1290, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1290, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1290, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1290, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1290, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_10(__pyx_t_3);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1290, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
        PyObject* sequence = __pyx_t_2;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1290, __pyx_L1_error)
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_7 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_7 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_9);
        #else
        __pyx_t_7 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1290, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1290, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        #endif
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1290, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext;
        index = 0; __pyx_t_7 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_7)) goto __pyx_L21_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_7);
        index = 1; __pyx_t_9 = __pyx_t_8(__pyx_t_6); if (unlikely(!__pyx_t_9)) goto __pyx_L21_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_6), 2) < 0) __PYX_ERR(0, 1290, __pyx_L1_error)
        __pyx_t_8 = NULL;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        goto __pyx_L22_unpacking_done;
        __pyx_L21_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_8 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1290, __pyx_L1_error)
        __pyx_L22_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_7);
      __pyx_t_7 = 0;
      if ((likely(PyTuple_CheckExact(__pyx_t_9))) || (PyList_CheckExact(__pyx_t_9))) {
        PyObject* sequence = __pyx_t_9;
        #if CYTHON_COMPILING_IN_CPYTHON
        Py_ssize_t size = Py_SIZE(sequence);
        #else
        Py_ssize_t size = PySequence_Size(sequence);
        #endif
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 1290, __pyx_L1_error)
        }
        #if CYTHON_COMPILING_IN_CPYTHON
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_12 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_4 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_12 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_12);
        #else
        __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1290, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1290, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_12 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1290, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        #endif
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_13 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1290, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __pyx_t_8 = Py_TYPE(__pyx_t_13)->tp_iternext;
        index = 0; __pyx_t_6 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_6)) goto __pyx_L23_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_6);
        index = 1; __pyx_t_4 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_4)) goto __pyx_L23_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_4);
        index = 2; __pyx_t_12 = __pyx_t_8(__pyx_t_13); if (unlikely(!__pyx_t_12)) goto __pyx_L23_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_12);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_13), 3) < 0) __PYX_ERR(0, 1290, __pyx_L1_error)
        __pyx_t_8 = NULL;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        goto __pyx_L24_unpacking_done;
        __pyx_L23_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_8 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 1290, __pyx_L1_error)
        __pyx_L24_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_fn, __pyx_t_6);
      __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_4);
      __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_deterministic, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "sweepea.pyx":1291
 *         if self._functions:
 *             for name, (fn, n, deterministic) in self._functions.items():
 *                 self._create_function(conn, fn, name, n, deterministic)             # <<<<<<<<<<<<<<
 * 
 *         if self._table_functions:
 */
      __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->_create_function(__pyx_v_self, __pyx_v_conn, __pyx_v_fn, __pyx_v_name, __pyx_v_n, __pyx_v_deterministic); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "sweepea.pyx":1290
 * 
 *         if self._functions:
 *             for name, (fn, n, deterministic) in self._functions.items():             # <<<<<<<<<<<<<<
 *                 self._create_function(conn, fn, name, n, deterministic)
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "sweepea.pyx":1289
 *                 self._create_collation(conn, fn, name)
 * 
 *         if self._functions:             # <<<<<<<<<<<<<<
 *             for name, (fn, n, deterministic) in self._functions.items():
 *                 self._create_function(conn, fn, name, n, deterministic)
 */
  }

  /* "sweepea.pyx":1293
 *                 self._create_function(conn, fn, name, n, deterministic)
 * 
 *         if self._table_functions:             # <<<<<<<<<<<<<<
 *             for table_function in self._table_functions:
 *                 table_function.register(conn)
 */
  __pyx_t_1 = (__pyx_v_self->_table_functions != Py_None) && (PyList_GET_SIZE(__pyx_v_self->_table_functions) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":1294
 * 
 *         if self._table_functions:
 *             for table_function in self._table_functions:             # <<<<<<<<<<<<<<
 *                 table_function.register(conn)
 * 
 */
    if (unlikely(__pyx_v_self->_table_functions == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(0, 1294, __pyx_L1_error)
    }
    __pyx_t_3 = __pyx_v_self->_table_functions; __Pyx_INCREF(__pyx_t_3); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
      #if CYTHON_COMPILING_IN_CPYTHON
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 1294, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1294, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_table_function, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "sweepea.pyx":1295
 *         if self._table_functions:
 *             for table_function in self._table_functions:
 *                 table_function.register(conn)             # <<<<<<<<<<<<<<
 * 
 *         if self._commit_hook is not None:
 */
      __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_table_function, __pyx_n_s_register); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1295, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
        }
      }
      if (!__pyx_t_7) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_conn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1295, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
        __Pyx_INCREF(__pyx_v_conn);
        __Pyx_GIVEREF(__pyx_v_conn);
        PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_conn);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "sweepea.pyx":1294
 * 
 *         if self._table_functions:
 *             for table_function in self._table_functions:             # <<<<<<<<<<<<<<
 *                 table_function.register(conn)
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "sweepea.pyx":1293
 *                 self._create_function(conn, fn, name, n, deterministic)
 * 
 *         if self._table_functions:             # <<<<<<<<<<<<<<
 *             for table_function in self._table_functions:
 *                 table_function.register(conn)
 */
  }

  /* "sweepea.pyx":1297
 *                 table_function.register(conn)
 * 
 *         if self._commit_hook is not None:             # <<<<<<<<<<<<<<
 *             self._set_commit_hook(conn, self._commit_hook)
 *         if self._rollback_hook is not None:
 */
  __pyx_t_1 = (__pyx_v_self->_commit_hook != Py_None);
  __pyx_t_14 = (__pyx_t_1 != 0);
  if (__pyx_t_14) {

    /* "sweepea.pyx":1298
 * 
 *         if self._commit_hook is not None:
 *             self._set_commit_hook(conn, self._commit_hook)             # <<<<<<<<<<<<<<
 *         if self._rollback_hook is not None:
 *             self._set_rollback_hook(conn, self._rollback_hook)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_commit_hook); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    __pyx_t_12 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_9) {
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
    }
    __Pyx_INCREF(__pyx_v_conn);
    __Pyx_GIVEREF(__pyx_v_conn);
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_5, __pyx_v_conn);
    __Pyx_INCREF(__pyx_v_self->_commit_hook);
    __Pyx_GIVEREF(__pyx_v_self->_commit_hook);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_5, __pyx_v_self->_commit_hook);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1298, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "sweepea.pyx":1297
 *                 table_function.register(conn)
 * 
 *         if self._commit_hook is not None:             # <<<<<<<<<<<<<<
 *             self._set_commit_hook(conn, self._commit_hook)
 *         if self._rollback_hook is not None:
 */
  }

  /* "sweepea.pyx":1299
 *         if self._commit_hook is not None:
 *             self._set_commit_hook(conn, self._commit_hook)
 *         if self._rollback_hook is not None:             # <<<<<<<<<<<<<<
 *             self._set_rollback_hook(conn, self._rollback_hook)
 *         if self._update_hook is not None:
 */
  __pyx_t_14 = (__pyx_v_self->_rollback_hook != Py_None);
  __pyx_t_1 = (__pyx_t_14 != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":1300
 *             self._set_commit_hook(conn, self._commit_hook)
 *         if self._rollback_hook is not None:
 *             self._set_rollback_hook(conn, self._rollback_hook)             # <<<<<<<<<<<<<<
 *         if self._update_hook is not None:
 *             self._set_update_hook(conn, self._update_hook)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_rollback_hook); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_12 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    __pyx_t_9 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_12) {
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12); __pyx_t_12 = NULL;
    }
    __Pyx_INCREF(__pyx_v_conn);
    __Pyx_GIVEREF(__pyx_v_conn);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_5, __pyx_v_conn);
    __Pyx_INCREF(__pyx_v_self->_rollback_hook);
    __Pyx_GIVEREF(__pyx_v_self->_rollback_hook);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_5, __pyx_v_self->_rollback_hook);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "sweepea.pyx":1299
 *         if self._commit_hook is not None:
 *             self._set_commit_hook(conn, self._commit_hook)
 *         if self._rollback_hook is not None:             # <<<<<<<<<<<<<<
 *             self._set_rollback_hook(conn, self._rollback_hook)
 *         if self._update_hook is not None:
 */
  }

  /* "sweepea.pyx":1301
 *         if self._rollback_hook is not None:
 *             self._set_rollback_hook(conn, self._rollback_hook)
 *         if self._update_hook is not None:             # <<<<<<<<<<<<<<
 *             self._set_update_hook(conn, self._update_hook)
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_update_hook != Py_None);
  __pyx_t_14 = (__pyx_t_1 != 0);
  if (__pyx_t_14) {

    /* "sweepea.pyx":1302
 *             self._set_rollback_hook(conn, self._rollback_hook)
 *         if self._update_hook is not None:
 *             self._set_update_hook(conn, self._update_hook)             # <<<<<<<<<<<<<<
 * 
 *     def _create_aggregate(self, conn, klass, name, nparams=-1):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_update_hook); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    __pyx_t_12 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_9) {
      __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_9); __pyx_t_9 = NULL;
    }
    __Pyx_INCREF(__pyx_v_conn);
    __Pyx_GIVEREF(__pyx_v_conn);
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_5, __pyx_v_conn);
    __Pyx_INCREF(__pyx_v_self->_update_hook);
    __Pyx_GIVEREF(__pyx_v_self->_update_hook);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_5, __pyx_v_self->_update_hook);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "sweepea.pyx":1301
 *         if self._rollback_hook is not None:
 *             self._set_rollback_hook(conn, self._rollback_hook)
 *         if self._update_hook is not None:             # <<<<<<<<<<<<<<
 *             self._set_update_hook(conn, self._update_hook)
 * 
 */
  }

  /* "sweepea.pyx":1268
 *             return False
 * 
 *     def initialize_connection(self, conn):             # <<<<<<<<<<<<<<
 *         """
 *         Initialize the connection by setting per-connection-state, registering
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("sweepea.Database.initialize_connection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cursor);
  __Pyx_XDECREF(__pyx_v_pragma);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_klass);
  __Pyx_XDECREF(__pyx_v_fn);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_deterministic);
  __Pyx_XDECREF(__pyx_v_table_function);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1304
 *             self._set_update_hook(conn, self._update_hook)
 * 
 *     def _create_aggregate(self, conn, klass, name, nparams=-1):             # <<<<<<<<<<<<<<
 *         conn.create_aggregate(name, nparams, klass)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_13_create_aggregate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_8Database_13_create_aggregate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_conn = 0;
  PyObject *__pyx_v_klass = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_nparams = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_create_aggregate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_conn,&__pyx_n_s_klass,&__pyx_n_s_name,&__pyx_n_s_nparams,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)__pyx_int_neg_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  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_klass)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_create_aggregate", 0, 3, 4, 1); __PYX_ERR(0, 1304, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_create_aggregate", 0, 3, 4, 2); __PYX_ERR(0, 1304, __pyx_L3_error)
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nparams);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_create_aggregate") < 0)) __PYX_ERR(0, 1304, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_conn = values[0];
    __pyx_v_klass = values[1];
    __pyx_v_name = values[2];
    __pyx_v_nparams = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_create_aggregate", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1304, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Database._create_aggregate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_12_create_aggregate(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_conn, __pyx_v_klass, __pyx_v_name, __pyx_v_nparams);

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

static PyObject *__pyx_pf_7sweepea_8Database_12_create_aggregate(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_conn, PyObject *__pyx_v_klass, PyObject *__pyx_v_name, PyObject *__pyx_v_nparams) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_create_aggregate", 0);

  /* "sweepea.pyx":1305
 * 
 *     def _create_aggregate(self, conn, klass, name, nparams=-1):
 *         conn.create_aggregate(name, nparams, klass)             # <<<<<<<<<<<<<<
 * 
 *     def aggregate(self, name=None):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_create_aggregate_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_name);
  __Pyx_INCREF(__pyx_v_nparams);
  __Pyx_GIVEREF(__pyx_v_nparams);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_nparams);
  __Pyx_INCREF(__pyx_v_klass);
  __Pyx_GIVEREF(__pyx_v_klass);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_klass);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1304
 *             self._set_update_hook(conn, self._update_hook)
 * 
 *     def _create_aggregate(self, conn, klass, name, nparams=-1):             # <<<<<<<<<<<<<<
 *         conn.create_aggregate(name, nparams, klass)
 * 
 */

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

/* "sweepea.pyx":1307
 *         conn.create_aggregate(name, nparams, klass)
 * 
 *     def aggregate(self, name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Class decorator for user-defined aggregates.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_15aggregate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7sweepea_8Database_14aggregate[] = "\n        Class decorator for user-defined aggregates.\n\n        Example::\n\n            @db.aggregate('avg')\n            class Average(object):\n                def __init__(self):\n                    self.vals = []\n\n                def step(self, value):\n                    self.vals.append(value)\n\n                def finalize(self):\n                    return avg(self.vals)\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_15aggregate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("aggregate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "aggregate") < 0)) __PYX_ERR(0, 1307, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("aggregate", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1307, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Database.aggregate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_14aggregate(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_name);

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

/* "sweepea.pyx":1324
 *                     return avg(self.vals)
 *         """
 *         def decorator(klass):             # <<<<<<<<<<<<<<
 *             aggregate_name = name or klass.__name__
 *             self._aggregates[aggregate_name] = klass
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_9aggregate_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_klass); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_8Database_9aggregate_1decorator = {"decorator", (PyCFunction)__pyx_pw_7sweepea_8Database_9aggregate_1decorator, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_8Database_9aggregate_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_klass) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_9aggregate_decorator(__pyx_self, ((PyObject *)__pyx_v_klass));

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

static PyObject *__pyx_pf_7sweepea_8Database_9aggregate_decorator(PyObject *__pyx_self, PyObject *__pyx_v_klass) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate *__pyx_cur_scope;
  struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate *__pyx_outer_scope;
  PyObject *__pyx_v_aggregate_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("decorator", 0);
  __pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "sweepea.pyx":1325
 *         """
 *         def decorator(klass):
 *             aggregate_name = name or klass.__name__             # <<<<<<<<<<<<<<
 *             self._aggregates[aggregate_name] = klass
 *             if not self.is_closed():
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(0, 1325, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_name); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1325, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name);
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_name;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_klass, __pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_aggregate_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1326
 *         def decorator(klass):
 *             aggregate_name = name or klass.__name__
 *             self._aggregates[aggregate_name] = klass             # <<<<<<<<<<<<<<
 *             if not self.is_closed():
 *                 self._create_aggregate(self.get_conn(), klass, aggregate_name)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1326, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_self->_aggregates == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1326, __pyx_L1_error)
  }
  if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_self->_aggregates, __pyx_v_aggregate_name, __pyx_v_klass) < 0)) __PYX_ERR(0, 1326, __pyx_L1_error)

  /* "sweepea.pyx":1327
 *             aggregate_name = name or klass.__name__
 *             self._aggregates[aggregate_name] = klass
 *             if not self.is_closed():             # <<<<<<<<<<<<<<
 *                 self._create_aggregate(self.get_conn(), klass, aggregate_name)
 *             return klass
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1327, __pyx_L1_error) }
  __pyx_t_2 = ((!(((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->is_closed(__pyx_cur_scope->__pyx_v_self, 0) != 0)) != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1328
 *             self._aggregates[aggregate_name] = klass
 *             if not self.is_closed():
 *                 self._create_aggregate(self.get_conn(), klass, aggregate_name)             # <<<<<<<<<<<<<<
 *             return klass
 *         return decorator
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1328, __pyx_L1_error) }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_cur_scope->__pyx_v_self), __pyx_n_s_create_aggregate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1328, __pyx_L1_error) }
    __pyx_t_4 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->get_conn(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_klass);
    __Pyx_GIVEREF(__pyx_v_klass);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_klass);
    __Pyx_INCREF(__pyx_v_aggregate_name);
    __Pyx_GIVEREF(__pyx_v_aggregate_name);
    PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_aggregate_name);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __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_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":1327
 *             aggregate_name = name or klass.__name__
 *             self._aggregates[aggregate_name] = klass
 *             if not self.is_closed():             # <<<<<<<<<<<<<<
 *                 self._create_aggregate(self.get_conn(), klass, aggregate_name)
 *             return klass
 */
  }

  /* "sweepea.pyx":1329
 *             if not self.is_closed():
 *                 self._create_aggregate(self.get_conn(), klass, aggregate_name)
 *             return klass             # <<<<<<<<<<<<<<
 *         return decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_klass);
  __pyx_r = __pyx_v_klass;
  goto __pyx_L0;

  /* "sweepea.pyx":1324
 *                     return avg(self.vals)
 *         """
 *         def decorator(klass):             # <<<<<<<<<<<<<<
 *             aggregate_name = name or klass.__name__
 *             self._aggregates[aggregate_name] = klass
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("sweepea.Database.aggregate.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_aggregate_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1307
 *         conn.create_aggregate(name, nparams, klass)
 * 
 *     def aggregate(self, name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Class decorator for user-defined aggregates.
 */

static PyObject *__pyx_pf_7sweepea_8Database_14aggregate(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_name) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate *__pyx_cur_scope;
  PyObject *__pyx_v_decorator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("aggregate", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate *)__pyx_tp_new_7sweepea___pyx_scope_struct_6_aggregate(__pyx_ptype_7sweepea___pyx_scope_struct_6_aggregate, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_name = __pyx_v_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name);

  /* "sweepea.pyx":1324
 *                     return avg(self.vals)
 *         """
 *         def decorator(klass):             # <<<<<<<<<<<<<<
 *             aggregate_name = name or klass.__name__
 *             self._aggregates[aggregate_name] = klass
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_8Database_9aggregate_1decorator, 0, __pyx_n_s_aggregate_locals_decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1330
 *                 self._create_aggregate(self.get_conn(), klass, aggregate_name)
 *             return klass
 *         return decorator             # <<<<<<<<<<<<<<
 * 
 *     cdef _create_collation(self, conn, fn, name):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "sweepea.pyx":1307
 *         conn.create_aggregate(name, nparams, klass)
 * 
 *     def aggregate(self, name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Class decorator for user-defined aggregates.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.Database.aggregate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1332
 *         return decorator
 * 
 *     cdef _create_collation(self, conn, fn, name):             # <<<<<<<<<<<<<<
 *         conn.create_collation(name, fn)
 * 
 */

static PyObject *__pyx_f_7sweepea_8Database__create_collation(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_conn, PyObject *__pyx_v_fn, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_create_collation", 0);

  /* "sweepea.pyx":1333
 * 
 *     cdef _create_collation(self, conn, fn, name):
 *         conn.create_collation(name, fn)             # <<<<<<<<<<<<<<
 * 
 *     def collation(self, name=None):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_conn, __pyx_n_s_create_collation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_name);
  __Pyx_INCREF(__pyx_v_fn);
  __Pyx_GIVEREF(__pyx_v_fn);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_fn);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1332
 *         return decorator
 * 
 *     cdef _create_collation(self, conn, fn, name):             # <<<<<<<<<<<<<<
 *         conn.create_collation(name, fn)
 * 
 */

  /* 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("sweepea.Database._create_collation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1335
 *         conn.create_collation(name, fn)
 * 
 *     def collation(self, name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Register a custom collation.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_17collation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7sweepea_8Database_16collation[] = "\n        Register a custom collation.\n\n        Example::\n\n            @db.collation('numeric')\n            def numeric(lhs, rhs):\n                # Sort strings with numbers in them.\n                l1 = [int(t) if t.isdigit() else t\n                      for t in re.split('(\\d+)', lhs)]\n                l2 = [int(t) if t.isdigit() else t\n                      for t in re.split('(\\d+)', lhs)]\n                return cmp(l1, l2)\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_17collation(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("collation (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "collation") < 0)) __PYX_ERR(0, 1335, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("collation", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1335, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Database.collation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_16collation(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_name);

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

/* "sweepea.pyx":1350
 *                 return cmp(l1, l2)
 *         """
 *         def decorator(fn):             # <<<<<<<<<<<<<<
 *             collation_name = name or fn.__name__
 *             self._collations[collation_name] = fn
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_9collation_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_fn); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_8Database_9collation_1decorator = {"decorator", (PyCFunction)__pyx_pw_7sweepea_8Database_9collation_1decorator, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_8Database_9collation_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_fn) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_9collation_decorator(__pyx_self, ((PyObject *)__pyx_v_fn));

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

static PyObject *__pyx_pf_7sweepea_8Database_9collation_decorator(PyObject *__pyx_self, PyObject *__pyx_v_fn) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation *__pyx_cur_scope;
  struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation *__pyx_outer_scope;
  PyObject *__pyx_v_collation_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("decorator", 0);
  __pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "sweepea.pyx":1351
 *         """
 *         def decorator(fn):
 *             collation_name = name or fn.__name__             # <<<<<<<<<<<<<<
 *             self._collations[collation_name] = fn
 *             if not self.is_closed():
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(0, 1351, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_name); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1351, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name);
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_name;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fn, __pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_collation_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1352
 *         def decorator(fn):
 *             collation_name = name or fn.__name__
 *             self._collations[collation_name] = fn             # <<<<<<<<<<<<<<
 *             if not self.is_closed():
 *                 self._create_collation(self.get_conn(), fn, collation_name)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1352, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_self->_collations == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1352, __pyx_L1_error)
  }
  if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_self->_collations, __pyx_v_collation_name, __pyx_v_fn) < 0)) __PYX_ERR(0, 1352, __pyx_L1_error)

  /* "sweepea.pyx":1353
 *             collation_name = name or fn.__name__
 *             self._collations[collation_name] = fn
 *             if not self.is_closed():             # <<<<<<<<<<<<<<
 *                 self._create_collation(self.get_conn(), fn, collation_name)
 *         return decorator
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1353, __pyx_L1_error) }
  __pyx_t_2 = ((!(((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->is_closed(__pyx_cur_scope->__pyx_v_self, 0) != 0)) != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1354
 *             self._collations[collation_name] = fn
 *             if not self.is_closed():
 *                 self._create_collation(self.get_conn(), fn, collation_name)             # <<<<<<<<<<<<<<
 *         return decorator
 * 
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1354, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1354, __pyx_L1_error) }
    __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->get_conn(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->_create_collation(__pyx_cur_scope->__pyx_v_self, __pyx_t_1, __pyx_v_fn, __pyx_v_collation_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "sweepea.pyx":1353
 *             collation_name = name or fn.__name__
 *             self._collations[collation_name] = fn
 *             if not self.is_closed():             # <<<<<<<<<<<<<<
 *                 self._create_collation(self.get_conn(), fn, collation_name)
 *         return decorator
 */
  }

  /* "sweepea.pyx":1350
 *                 return cmp(l1, l2)
 *         """
 *         def decorator(fn):             # <<<<<<<<<<<<<<
 *             collation_name = name or fn.__name__
 *             self._collations[collation_name] = fn
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("sweepea.Database.collation.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_collation_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1335
 *         conn.create_collation(name, fn)
 * 
 *     def collation(self, name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Register a custom collation.
 */

static PyObject *__pyx_pf_7sweepea_8Database_16collation(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_name) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation *__pyx_cur_scope;
  PyObject *__pyx_v_decorator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("collation", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation *)__pyx_tp_new_7sweepea___pyx_scope_struct_7_collation(__pyx_ptype_7sweepea___pyx_scope_struct_7_collation, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_name = __pyx_v_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name);

  /* "sweepea.pyx":1350
 *                 return cmp(l1, l2)
 *         """
 *         def decorator(fn):             # <<<<<<<<<<<<<<
 *             collation_name = name or fn.__name__
 *             self._collations[collation_name] = fn
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_8Database_9collation_1decorator, 0, __pyx_n_s_collation_locals_decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1355
 *             if not self.is_closed():
 *                 self._create_collation(self.get_conn(), fn, collation_name)
 *         return decorator             # <<<<<<<<<<<<<<
 * 
 *     cdef _create_function(self, conn, fn, name, nparams, deterministic):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "sweepea.pyx":1335
 *         conn.create_collation(name, fn)
 * 
 *     def collation(self, name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Register a custom collation.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.Database.collation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1357
 *         return decorator
 * 
 *     cdef _create_function(self, conn, fn, name, nparams, deterministic):             # <<<<<<<<<<<<<<
 *         """
 *         Register a user-defined function using our own implementation. This has
 */

static PyObject *__pyx_f_7sweepea_8Database__create_function(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_conn, PyObject *__pyx_v_fn, PyObject *__pyx_v_name, PyObject *__pyx_v_nparams, PyObject *__pyx_v_deterministic) {
  pysqlite_Connection *__pyx_v_c_conn;
  int __pyx_v_flags;
  int __pyx_v_rc;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  char const *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("_create_function", 0);

  /* "sweepea.pyx":1364
 *         """
 *         cdef:
 *             pysqlite_Connection *c_conn = <pysqlite_Connection *>conn             # <<<<<<<<<<<<<<
 *             int flags = SQLITE_UTF8
 *             int rc
 */
  __pyx_v_c_conn = ((pysqlite_Connection *)__pyx_v_conn);

  /* "sweepea.pyx":1365
 *         cdef:
 *             pysqlite_Connection *c_conn = <pysqlite_Connection *>conn
 *             int flags = SQLITE_UTF8             # <<<<<<<<<<<<<<
 *             int rc
 * 
 */
  __pyx_v_flags = SQLITE_UTF8;

  /* "sweepea.pyx":1368
 *             int rc
 * 
 *         _check_connection(c_conn)             # <<<<<<<<<<<<<<
 *         if deterministic:
 *             flags |= SQLITE_DETERMINISTIC
 */
  __pyx_t_1 = __pyx_f_7sweepea__check_connection(__pyx_v_c_conn); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 1368, __pyx_L1_error)

  /* "sweepea.pyx":1369
 * 
 *         _check_connection(c_conn)
 *         if deterministic:             # <<<<<<<<<<<<<<
 *             flags |= SQLITE_DETERMINISTIC
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_deterministic); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1369, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "sweepea.pyx":1370
 *         _check_connection(c_conn)
 *         if deterministic:
 *             flags |= SQLITE_DETERMINISTIC             # <<<<<<<<<<<<<<
 * 
 *         rc = sqlite3_create_function(c_conn.db, <const char *>name, nparams,
 */
    __pyx_v_flags = (__pyx_v_flags | SQLITE_DETERMINISTIC);

    /* "sweepea.pyx":1369
 * 
 *         _check_connection(c_conn)
 *         if deterministic:             # <<<<<<<<<<<<<<
 *             flags |= SQLITE_DETERMINISTIC
 * 
 */
  }

  /* "sweepea.pyx":1372
 *             flags |= SQLITE_DETERMINISTIC
 * 
 *         rc = sqlite3_create_function(c_conn.db, <const char *>name, nparams,             # <<<<<<<<<<<<<<
 *                                      flags, <void *>fn, _function_callback,
 *                                      NULL, NULL)
 */
  __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_v_name); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(0, 1372, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_nparams); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1372, __pyx_L1_error)

  /* "sweepea.pyx":1374
 *         rc = sqlite3_create_function(c_conn.db, <const char *>name, nparams,
 *                                      flags, <void *>fn, _function_callback,
 *                                      NULL, NULL)             # <<<<<<<<<<<<<<
 * 
 *         if rc != SQLITE_OK:
 */
  __pyx_v_rc = sqlite3_create_function(__pyx_v_c_conn->db, ((char const *)__pyx_t_3), __pyx_t_1, __pyx_v_flags, ((void *)__pyx_v_fn), __pyx_f_7sweepea__function_callback, NULL, NULL);

  /* "sweepea.pyx":1376
 *                                      NULL, NULL)
 * 
 *         if rc != SQLITE_OK:             # <<<<<<<<<<<<<<
 *             raise ValueError('Error calling sqlite3_create_function.')
 *         else:
 */
  __pyx_t_2 = ((__pyx_v_rc != SQLITE_OK) != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1377
 * 
 *         if rc != SQLITE_OK:
 *             raise ValueError('Error calling sqlite3_create_function.')             # <<<<<<<<<<<<<<
 *         else:
 *             self._function_map[fn] = name
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1377, __pyx_L1_error)

    /* "sweepea.pyx":1376
 *                                      NULL, NULL)
 * 
 *         if rc != SQLITE_OK:             # <<<<<<<<<<<<<<
 *             raise ValueError('Error calling sqlite3_create_function.')
 *         else:
 */
  }

  /* "sweepea.pyx":1379
 *             raise ValueError('Error calling sqlite3_create_function.')
 *         else:
 *             self._function_map[fn] = name             # <<<<<<<<<<<<<<
 * 
 *     def func(self, name=None, n=-1, deterministic=True):
 */
  /*else*/ {
    if (unlikely(__pyx_v_self->_function_map == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(0, 1379, __pyx_L1_error)
    }
    if (unlikely(PyDict_SetItem(__pyx_v_self->_function_map, __pyx_v_fn, __pyx_v_name) < 0)) __PYX_ERR(0, 1379, __pyx_L1_error)
  }

  /* "sweepea.pyx":1357
 *         return decorator
 * 
 *     cdef _create_function(self, conn, fn, name, nparams, deterministic):             # <<<<<<<<<<<<<<
 *         """
 *         Register a user-defined function using our own implementation. This has
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("sweepea.Database._create_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1381
 *             self._function_map[fn] = name
 * 
 *     def func(self, name=None, n=-1, deterministic=True):             # <<<<<<<<<<<<<<
 *         """
 *         Create a user-defined function.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_19func(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7sweepea_8Database_18func[] = "\n        Create a user-defined function.\n\n        Example::\n\n            @db.func('md5')\n            def md5(s):\n                return hashlib.md5(s).hexdigest()\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_19func(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_v_deterministic = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("func (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_n,&__pyx_n_s_deterministic,0};
    PyObject* values[3] = {0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)__pyx_int_neg_1);
    values[2] = ((PyObject *)Py_True);
    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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_deterministic);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "func") < 0)) __PYX_ERR(0, 1381, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
    __pyx_v_n = values[1];
    __pyx_v_deterministic = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("func", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1381, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Database.func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_18func(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_name, __pyx_v_n, __pyx_v_deterministic);

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

/* "sweepea.pyx":1391
 *                 return hashlib.md5(s).hexdigest()
 *         """
 *         def decorator(fn):             # <<<<<<<<<<<<<<
 *             fn_name = name or fn.__name__
 *             self._functions[fn_name] = (fn, n, deterministic)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_4func_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_fn); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_8Database_4func_1decorator = {"decorator", (PyCFunction)__pyx_pw_7sweepea_8Database_4func_1decorator, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_8Database_4func_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_fn) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_4func_decorator(__pyx_self, ((PyObject *)__pyx_v_fn));

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

static PyObject *__pyx_pf_7sweepea_8Database_4func_decorator(PyObject *__pyx_self, PyObject *__pyx_v_fn) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_8_func *__pyx_cur_scope;
  struct __pyx_obj_7sweepea___pyx_scope_struct_8_func *__pyx_outer_scope;
  PyObject *__pyx_v_fn_name = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("decorator", 0);
  __pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_8_func *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "sweepea.pyx":1392
 *         """
 *         def decorator(fn):
 *             fn_name = name or fn.__name__             # <<<<<<<<<<<<<<
 *             self._functions[fn_name] = (fn, n, deterministic)
 *             if not self.is_closed():
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(0, 1392, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_name); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1392, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name);
    __pyx_t_1 = __pyx_cur_scope->__pyx_v_name;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_fn, __pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_fn_name = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1393
 *         def decorator(fn):
 *             fn_name = name or fn.__name__
 *             self._functions[fn_name] = (fn, n, deterministic)             # <<<<<<<<<<<<<<
 *             if not self.is_closed():
 *                 self._create_function(self.get_conn(), fn, fn_name, n,
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_n)) { __Pyx_RaiseClosureNameError("n"); __PYX_ERR(0, 1393, __pyx_L1_error) }
  if (unlikely(!__pyx_cur_scope->__pyx_v_deterministic)) { __Pyx_RaiseClosureNameError("deterministic"); __PYX_ERR(0, 1393, __pyx_L1_error) }
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_fn);
  __Pyx_GIVEREF(__pyx_v_fn);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_fn);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_n);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_n);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_n);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_deterministic);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_deterministic);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_cur_scope->__pyx_v_deterministic);
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1393, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_self->_functions == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(0, 1393, __pyx_L1_error)
  }
  if (unlikely(PyDict_SetItem(__pyx_cur_scope->__pyx_v_self->_functions, __pyx_v_fn_name, __pyx_t_1) < 0)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1394
 *             fn_name = name or fn.__name__
 *             self._functions[fn_name] = (fn, n, deterministic)
 *             if not self.is_closed():             # <<<<<<<<<<<<<<
 *                 self._create_function(self.get_conn(), fn, fn_name, n,
 *                                       deterministic)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1394, __pyx_L1_error) }
  __pyx_t_2 = ((!(((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->is_closed(__pyx_cur_scope->__pyx_v_self, 0) != 0)) != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1395
 *             self._functions[fn_name] = (fn, n, deterministic)
 *             if not self.is_closed():
 *                 self._create_function(self.get_conn(), fn, fn_name, n,             # <<<<<<<<<<<<<<
 *                                       deterministic)
 *             return fn
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1395, __pyx_L1_error) }
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1395, __pyx_L1_error) }
    __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->get_conn(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (unlikely(!__pyx_cur_scope->__pyx_v_n)) { __Pyx_RaiseClosureNameError("n"); __PYX_ERR(0, 1395, __pyx_L1_error) }
    __pyx_t_3 = __pyx_cur_scope->__pyx_v_n;
    __Pyx_INCREF(__pyx_t_3);

    /* "sweepea.pyx":1396
 *             if not self.is_closed():
 *                 self._create_function(self.get_conn(), fn, fn_name, n,
 *                                       deterministic)             # <<<<<<<<<<<<<<
 *             return fn
 *         return decorator
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_deterministic)) { __Pyx_RaiseClosureNameError("deterministic"); __PYX_ERR(0, 1396, __pyx_L1_error) }
    __pyx_t_4 = __pyx_cur_scope->__pyx_v_deterministic;
    __Pyx_INCREF(__pyx_t_4);

    /* "sweepea.pyx":1395
 *             self._functions[fn_name] = (fn, n, deterministic)
 *             if not self.is_closed():
 *                 self._create_function(self.get_conn(), fn, fn_name, n,             # <<<<<<<<<<<<<<
 *                                       deterministic)
 *             return fn
 */
    __pyx_t_5 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->_create_function(__pyx_cur_scope->__pyx_v_self, __pyx_t_1, __pyx_v_fn, __pyx_v_fn_name, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1395, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "sweepea.pyx":1394
 *             fn_name = name or fn.__name__
 *             self._functions[fn_name] = (fn, n, deterministic)
 *             if not self.is_closed():             # <<<<<<<<<<<<<<
 *                 self._create_function(self.get_conn(), fn, fn_name, n,
 *                                       deterministic)
 */
  }

  /* "sweepea.pyx":1397
 *                 self._create_function(self.get_conn(), fn, fn_name, n,
 *                                       deterministic)
 *             return fn             # <<<<<<<<<<<<<<
 *         return decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_fn);
  __pyx_r = __pyx_v_fn;
  goto __pyx_L0;

  /* "sweepea.pyx":1391
 *                 return hashlib.md5(s).hexdigest()
 *         """
 *         def decorator(fn):             # <<<<<<<<<<<<<<
 *             fn_name = name or fn.__name__
 *             self._functions[fn_name] = (fn, n, deterministic)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea.Database.func.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_fn_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1381
 *             self._function_map[fn] = name
 * 
 *     def func(self, name=None, n=-1, deterministic=True):             # <<<<<<<<<<<<<<
 *         """
 *         Create a user-defined function.
 */

static PyObject *__pyx_pf_7sweepea_8Database_18func(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_n, PyObject *__pyx_v_deterministic) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_8_func *__pyx_cur_scope;
  PyObject *__pyx_v_decorator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("func", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_8_func *)__pyx_tp_new_7sweepea___pyx_scope_struct_8_func(__pyx_ptype_7sweepea___pyx_scope_struct_8_func, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_name = __pyx_v_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name);
  __pyx_cur_scope->__pyx_v_n = __pyx_v_n;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_n);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_n);
  __pyx_cur_scope->__pyx_v_deterministic = __pyx_v_deterministic;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_deterministic);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_deterministic);

  /* "sweepea.pyx":1391
 *                 return hashlib.md5(s).hexdigest()
 *         """
 *         def decorator(fn):             # <<<<<<<<<<<<<<
 *             fn_name = name or fn.__name__
 *             self._functions[fn_name] = (fn, n, deterministic)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_8Database_4func_1decorator, 0, __pyx_n_s_func_locals_decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__43)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1398
 *                                       deterministic)
 *             return fn
 *         return decorator             # <<<<<<<<<<<<<<
 * 
 *     def table_function(self, name=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "sweepea.pyx":1381
 *             self._function_map[fn] = name
 * 
 *     def func(self, name=None, n=-1, deterministic=True):             # <<<<<<<<<<<<<<
 *         """
 *         Create a user-defined function.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.Database.func", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1400
 *         return decorator
 * 
 *     def table_function(self, name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Register a table-function with the database.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_21table_function(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7sweepea_8Database_20table_function[] = "\n        Register a table-function with the database.\n\n        @db.table_function('series')\n        class Series(TableFunction):\n            columns = ['value']\n            params = ['start', 'stop']\n\n            def initialize(self, start=0, stop=None):\n                self.start, self.stop = start, (stop or float('Inf'))\n                self.curr = self.start\n\n            def iterate(self, idx):\n                if self.curr > self.stop:\n                    raise StopIteration\n                ret = self.curr\n                self.curr += 1\n                return (ret,)\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_21table_function(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("table_function (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "table_function") < 0)) __PYX_ERR(0, 1400, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_name = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("table_function", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1400, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Database.table_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_20table_function(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_name);

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

/* "sweepea.pyx":1420
 *                 return (ret,)
 *         """
 *         def decorator(klass):             # <<<<<<<<<<<<<<
 *             if name is not None:
 *                 klass.name = name
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_14table_function_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_klass); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_8Database_14table_function_1decorator = {"decorator", (PyCFunction)__pyx_pw_7sweepea_8Database_14table_function_1decorator, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_8Database_14table_function_1decorator(PyObject *__pyx_self, PyObject *__pyx_v_klass) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_14table_function_decorator(__pyx_self, ((PyObject *)__pyx_v_klass));

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

static PyObject *__pyx_pf_7sweepea_8Database_14table_function_decorator(PyObject *__pyx_self, PyObject *__pyx_v_klass) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function *__pyx_cur_scope;
  struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("decorator", 0);
  __pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "sweepea.pyx":1421
 *         """
 *         def decorator(klass):
 *             if name is not None:             # <<<<<<<<<<<<<<
 *                 klass.name = name
 *             self._table_functions.append(klass)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(0, 1421, __pyx_L1_error) }
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_name != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1422
 *         def decorator(klass):
 *             if name is not None:
 *                 klass.name = name             # <<<<<<<<<<<<<<
 *             self._table_functions.append(klass)
 *             if not self.is_closed():
 */
    if (unlikely(!__pyx_cur_scope->__pyx_v_name)) { __Pyx_RaiseClosureNameError("name"); __PYX_ERR(0, 1422, __pyx_L1_error) }
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_klass, __pyx_n_s_name, __pyx_cur_scope->__pyx_v_name) < 0) __PYX_ERR(0, 1422, __pyx_L1_error)

    /* "sweepea.pyx":1421
 *         """
 *         def decorator(klass):
 *             if name is not None:             # <<<<<<<<<<<<<<
 *                 klass.name = name
 *             self._table_functions.append(klass)
 */
  }

  /* "sweepea.pyx":1423
 *             if name is not None:
 *                 klass.name = name
 *             self._table_functions.append(klass)             # <<<<<<<<<<<<<<
 *             if not self.is_closed():
 *                 klass.register(self.get_conn())
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1423, __pyx_L1_error) }
  if (unlikely(__pyx_cur_scope->__pyx_v_self->_table_functions == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
    __PYX_ERR(0, 1423, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyList_Append(__pyx_cur_scope->__pyx_v_self->_table_functions, __pyx_v_klass); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 1423, __pyx_L1_error)

  /* "sweepea.pyx":1424
 *                 klass.name = name
 *             self._table_functions.append(klass)
 *             if not self.is_closed():             # <<<<<<<<<<<<<<
 *                 klass.register(self.get_conn())
 *             return klass
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1424, __pyx_L1_error) }
  __pyx_t_2 = ((!(((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->is_closed(__pyx_cur_scope->__pyx_v_self, 0) != 0)) != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1425
 *             self._table_functions.append(klass)
 *             if not self.is_closed():
 *                 klass.register(self.get_conn())             # <<<<<<<<<<<<<<
 *             return klass
 *         return decorator
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_klass, __pyx_n_s_register); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(!__pyx_cur_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 1425, __pyx_L1_error) }
    __pyx_t_6 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->get_conn(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1425, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1425, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1425, __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_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1425, __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;

    /* "sweepea.pyx":1424
 *                 klass.name = name
 *             self._table_functions.append(klass)
 *             if not self.is_closed():             # <<<<<<<<<<<<<<
 *                 klass.register(self.get_conn())
 *             return klass
 */
  }

  /* "sweepea.pyx":1426
 *             if not self.is_closed():
 *                 klass.register(self.get_conn())
 *             return klass             # <<<<<<<<<<<<<<
 *         return decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_klass);
  __pyx_r = __pyx_v_klass;
  goto __pyx_L0;

  /* "sweepea.pyx":1420
 *                 return (ret,)
 *         """
 *         def decorator(klass):             # <<<<<<<<<<<<<<
 *             if name is not None:
 *                 klass.name = name
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("sweepea.Database.table_function.decorator", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1400
 *         return decorator
 * 
 *     def table_function(self, name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Register a table-function with the database.
 */

static PyObject *__pyx_pf_7sweepea_8Database_20table_function(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_name) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function *__pyx_cur_scope;
  PyObject *__pyx_v_decorator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("table_function", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function *)__pyx_tp_new_7sweepea___pyx_scope_struct_9_table_function(__pyx_ptype_7sweepea___pyx_scope_struct_9_table_function, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __pyx_cur_scope->__pyx_v_name = __pyx_v_name;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_name);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_name);

  /* "sweepea.pyx":1420
 *                 return (ret,)
 *         """
 *         def decorator(klass):             # <<<<<<<<<<<<<<
 *             if name is not None:
 *                 klass.name = name
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_8Database_14table_function_1decorator, 0, __pyx_n_s_table_function_locals_decorator, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__45)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1427
 *                 klass.register(self.get_conn())
 *             return klass
 *         return decorator             # <<<<<<<<<<<<<<
 * 
 *     def on_commit(self, fn):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "sweepea.pyx":1400
 *         return decorator
 * 
 *     def table_function(self, name=None):             # <<<<<<<<<<<<<<
 *         """
 *         Register a table-function with the database.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.Database.table_function", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1429
 *         return decorator
 * 
 *     def on_commit(self, fn):             # <<<<<<<<<<<<<<
 *         """
 *         Register a post-commit hook. The handler's return value is ignored,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_23on_commit(PyObject *__pyx_v_self, PyObject *__pyx_v_fn); /*proto*/
static char __pyx_doc_7sweepea_8Database_22on_commit[] = "\n        Register a post-commit hook. The handler's return value is ignored,\n        but if a ValueError is raised, then the transaction will be rolled\n        back.\n\n        Example::\n\n            @db.on_commit\n            def commit_handler():\n                if datetime.date.today().weekday() == 6:\n                    raise ValueError('no commits on sunday!')\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_23on_commit(PyObject *__pyx_v_self, PyObject *__pyx_v_fn) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_commit (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_22on_commit(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_fn));

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

static PyObject *__pyx_pf_7sweepea_8Database_22on_commit(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_fn) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("on_commit", 0);

  /* "sweepea.pyx":1442
 *                     raise ValueError('no commits on sunday!')
 *         """
 *         self._commit_hook = fn             # <<<<<<<<<<<<<<
 *         if not self.is_closed():
 *             self._set_commit_hook(self.get_conn(), fn)
 */
  __Pyx_INCREF(__pyx_v_fn);
  __Pyx_GIVEREF(__pyx_v_fn);
  __Pyx_GOTREF(__pyx_v_self->_commit_hook);
  __Pyx_DECREF(__pyx_v_self->_commit_hook);
  __pyx_v_self->_commit_hook = __pyx_v_fn;

  /* "sweepea.pyx":1443
 *         """
 *         self._commit_hook = fn
 *         if not self.is_closed():             # <<<<<<<<<<<<<<
 *             self._set_commit_hook(self.get_conn(), fn)
 *         return fn
 */
  __pyx_t_1 = ((!(((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->is_closed(__pyx_v_self, 0) != 0)) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":1444
 *         self._commit_hook = fn
 *         if not self.is_closed():
 *             self._set_commit_hook(self.get_conn(), fn)             # <<<<<<<<<<<<<<
 *         return fn
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_commit_hook); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->get_conn(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_fn);
    __Pyx_GIVEREF(__pyx_v_fn);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_fn);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1443
 *         """
 *         self._commit_hook = fn
 *         if not self.is_closed():             # <<<<<<<<<<<<<<
 *             self._set_commit_hook(self.get_conn(), fn)
 *         return fn
 */
  }

  /* "sweepea.pyx":1445
 *         if not self.is_closed():
 *             self._set_commit_hook(self.get_conn(), fn)
 *         return fn             # <<<<<<<<<<<<<<
 * 
 *     def _set_commit_hook(self, connection, fn):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_fn);
  __pyx_r = __pyx_v_fn;
  goto __pyx_L0;

  /* "sweepea.pyx":1429
 *         return decorator
 * 
 *     def on_commit(self, fn):             # <<<<<<<<<<<<<<
 *         """
 *         Register a post-commit hook. The handler's return value is ignored,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("sweepea.Database.on_commit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1447
 *         return fn
 * 
 *     def _set_commit_hook(self, connection, fn):             # <<<<<<<<<<<<<<
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_25_set_commit_hook(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_8Database_25_set_commit_hook(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_connection = 0;
  PyObject *__pyx_v_fn = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_commit_hook (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_connection,&__pyx_n_s_fn,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_connection)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fn)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_set_commit_hook", 1, 2, 2, 1); __PYX_ERR(0, 1447, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_set_commit_hook") < 0)) __PYX_ERR(0, 1447, __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_connection = values[0];
    __pyx_v_fn = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set_commit_hook", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1447, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Database._set_commit_hook", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_24_set_commit_hook(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_connection, __pyx_v_fn);

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

static PyObject *__pyx_pf_7sweepea_8Database_24_set_commit_hook(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_connection, PyObject *__pyx_v_fn) {
  pysqlite_Connection *__pyx_v_conn;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_set_commit_hook", 0);

  /* "sweepea.pyx":1448
 * 
 *     def _set_commit_hook(self, connection, fn):
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection             # <<<<<<<<<<<<<<
 *         if fn is None:
 *             sqlite3_commit_hook(conn.db, NULL, NULL)
 */
  __pyx_v_conn = ((pysqlite_Connection *)__pyx_v_connection);

  /* "sweepea.pyx":1449
 *     def _set_commit_hook(self, connection, fn):
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:             # <<<<<<<<<<<<<<
 *             sqlite3_commit_hook(conn.db, NULL, NULL)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_fn == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1450
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:
 *             sqlite3_commit_hook(conn.db, NULL, NULL)             # <<<<<<<<<<<<<<
 *         else:
 *             sqlite3_commit_hook(conn.db, _commit_callback, <void *>fn)
 */
    sqlite3_commit_hook(__pyx_v_conn->db, NULL, NULL);

    /* "sweepea.pyx":1449
 *     def _set_commit_hook(self, connection, fn):
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:             # <<<<<<<<<<<<<<
 *             sqlite3_commit_hook(conn.db, NULL, NULL)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1452
 *             sqlite3_commit_hook(conn.db, NULL, NULL)
 *         else:
 *             sqlite3_commit_hook(conn.db, _commit_callback, <void *>fn)             # <<<<<<<<<<<<<<
 * 
 *     def on_rollback(self, fn):
 */
  /*else*/ {
    sqlite3_commit_hook(__pyx_v_conn->db, __pyx_f_7sweepea__commit_callback, ((void *)__pyx_v_fn));
  }
  __pyx_L3:;

  /* "sweepea.pyx":1447
 *         return fn
 * 
 *     def _set_commit_hook(self, connection, fn):             # <<<<<<<<<<<<<<
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:
 */

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

/* "sweepea.pyx":1454
 *             sqlite3_commit_hook(conn.db, _commit_callback, <void *>fn)
 * 
 *     def on_rollback(self, fn):             # <<<<<<<<<<<<<<
 *         """
 *         Register a rollback handler. Return value is ignored.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_27on_rollback(PyObject *__pyx_v_self, PyObject *__pyx_v_fn); /*proto*/
static char __pyx_doc_7sweepea_8Database_26on_rollback[] = "\n        Register a rollback handler. Return value is ignored.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_27on_rollback(PyObject *__pyx_v_self, PyObject *__pyx_v_fn) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_rollback (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_26on_rollback(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_fn));

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

static PyObject *__pyx_pf_7sweepea_8Database_26on_rollback(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_fn) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("on_rollback", 0);

  /* "sweepea.pyx":1458
 *         Register a rollback handler. Return value is ignored.
 *         """
 *         self._rollback_hook = fn             # <<<<<<<<<<<<<<
 *         if not self.is_closed():
 *             self._set_rollback_hook(self.get_conn(), fn)
 */
  __Pyx_INCREF(__pyx_v_fn);
  __Pyx_GIVEREF(__pyx_v_fn);
  __Pyx_GOTREF(__pyx_v_self->_rollback_hook);
  __Pyx_DECREF(__pyx_v_self->_rollback_hook);
  __pyx_v_self->_rollback_hook = __pyx_v_fn;

  /* "sweepea.pyx":1459
 *         """
 *         self._rollback_hook = fn
 *         if not self.is_closed():             # <<<<<<<<<<<<<<
 *             self._set_rollback_hook(self.get_conn(), fn)
 *         return fn
 */
  __pyx_t_1 = ((!(((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->is_closed(__pyx_v_self, 0) != 0)) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":1460
 *         self._rollback_hook = fn
 *         if not self.is_closed():
 *             self._set_rollback_hook(self.get_conn(), fn)             # <<<<<<<<<<<<<<
 *         return fn
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_rollback_hook); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->get_conn(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_fn);
    __Pyx_GIVEREF(__pyx_v_fn);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_fn);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1459
 *         """
 *         self._rollback_hook = fn
 *         if not self.is_closed():             # <<<<<<<<<<<<<<
 *             self._set_rollback_hook(self.get_conn(), fn)
 *         return fn
 */
  }

  /* "sweepea.pyx":1461
 *         if not self.is_closed():
 *             self._set_rollback_hook(self.get_conn(), fn)
 *         return fn             # <<<<<<<<<<<<<<
 * 
 *     def _set_rollback_hook(self, connection, fn):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_fn);
  __pyx_r = __pyx_v_fn;
  goto __pyx_L0;

  /* "sweepea.pyx":1454
 *             sqlite3_commit_hook(conn.db, _commit_callback, <void *>fn)
 * 
 *     def on_rollback(self, fn):             # <<<<<<<<<<<<<<
 *         """
 *         Register a rollback handler. Return value is ignored.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("sweepea.Database.on_rollback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1463
 *         return fn
 * 
 *     def _set_rollback_hook(self, connection, fn):             # <<<<<<<<<<<<<<
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_29_set_rollback_hook(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_8Database_29_set_rollback_hook(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_connection = 0;
  PyObject *__pyx_v_fn = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_rollback_hook (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_connection,&__pyx_n_s_fn,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_connection)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fn)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_set_rollback_hook", 1, 2, 2, 1); __PYX_ERR(0, 1463, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_set_rollback_hook") < 0)) __PYX_ERR(0, 1463, __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_connection = values[0];
    __pyx_v_fn = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set_rollback_hook", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1463, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Database._set_rollback_hook", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_28_set_rollback_hook(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_connection, __pyx_v_fn);

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

static PyObject *__pyx_pf_7sweepea_8Database_28_set_rollback_hook(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_connection, PyObject *__pyx_v_fn) {
  pysqlite_Connection *__pyx_v_conn;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_set_rollback_hook", 0);

  /* "sweepea.pyx":1464
 * 
 *     def _set_rollback_hook(self, connection, fn):
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection             # <<<<<<<<<<<<<<
 *         if fn is None:
 *             sqlite3_rollback_hook(conn.db, NULL, NULL)
 */
  __pyx_v_conn = ((pysqlite_Connection *)__pyx_v_connection);

  /* "sweepea.pyx":1465
 *     def _set_rollback_hook(self, connection, fn):
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:             # <<<<<<<<<<<<<<
 *             sqlite3_rollback_hook(conn.db, NULL, NULL)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_fn == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1466
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:
 *             sqlite3_rollback_hook(conn.db, NULL, NULL)             # <<<<<<<<<<<<<<
 *         else:
 *             sqlite3_rollback_hook(conn.db, _rollback_callback, <void *>fn)
 */
    sqlite3_rollback_hook(__pyx_v_conn->db, NULL, NULL);

    /* "sweepea.pyx":1465
 *     def _set_rollback_hook(self, connection, fn):
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:             # <<<<<<<<<<<<<<
 *             sqlite3_rollback_hook(conn.db, NULL, NULL)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1468
 *             sqlite3_rollback_hook(conn.db, NULL, NULL)
 *         else:
 *             sqlite3_rollback_hook(conn.db, _rollback_callback, <void *>fn)             # <<<<<<<<<<<<<<
 * 
 *     def on_update(self, fn):
 */
  /*else*/ {
    sqlite3_rollback_hook(__pyx_v_conn->db, __pyx_f_7sweepea__rollback_callback, ((void *)__pyx_v_fn));
  }
  __pyx_L3:;

  /* "sweepea.pyx":1463
 *         return fn
 * 
 *     def _set_rollback_hook(self, connection, fn):             # <<<<<<<<<<<<<<
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:
 */

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

/* "sweepea.pyx":1470
 *             sqlite3_rollback_hook(conn.db, _rollback_callback, <void *>fn)
 * 
 *     def on_update(self, fn):             # <<<<<<<<<<<<<<
 *         """
 *         Register an update hook. Hook is executed for each row that is
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_31on_update(PyObject *__pyx_v_self, PyObject *__pyx_v_fn); /*proto*/
static char __pyx_doc_7sweepea_8Database_30on_update[] = "\n        Register an update hook. Hook is executed for each row that is\n        inserted, updated or deleted. Return value is ignored.\n\n        User-defined callback must accept the following parameters:\n\n        * query type (INSERT, UPDATE or DELETE)\n        * database name (typically 'main')\n        * table name\n        * rowid of affected row\n\n        Example::\n\n            @db.on_update\n            def change_logger(query_type, db, table, rowid):\n                logger.debug('%s query on %s.%s row %s', query_type, db,\n                             table, rowid)\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_31on_update(PyObject *__pyx_v_self, PyObject *__pyx_v_fn) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_update (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_30on_update(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_fn));

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

static PyObject *__pyx_pf_7sweepea_8Database_30on_update(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_fn) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("on_update", 0);

  /* "sweepea.pyx":1489
 *                              table, rowid)
 *         """
 *         self._update_hook = fn             # <<<<<<<<<<<<<<
 *         if not self.is_closed():
 *             self._set_update_hook(self.get_conn(), fn)
 */
  __Pyx_INCREF(__pyx_v_fn);
  __Pyx_GIVEREF(__pyx_v_fn);
  __Pyx_GOTREF(__pyx_v_self->_update_hook);
  __Pyx_DECREF(__pyx_v_self->_update_hook);
  __pyx_v_self->_update_hook = __pyx_v_fn;

  /* "sweepea.pyx":1490
 *         """
 *         self._update_hook = fn
 *         if not self.is_closed():             # <<<<<<<<<<<<<<
 *             self._set_update_hook(self.get_conn(), fn)
 *         return fn
 */
  __pyx_t_1 = ((!(((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->is_closed(__pyx_v_self, 0) != 0)) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":1491
 *         self._update_hook = fn
 *         if not self.is_closed():
 *             self._set_update_hook(self.get_conn(), fn)             # <<<<<<<<<<<<<<
 *         return fn
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_update_hook); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->get_conn(__pyx_v_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_fn);
    __Pyx_GIVEREF(__pyx_v_fn);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_fn);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1490
 *         """
 *         self._update_hook = fn
 *         if not self.is_closed():             # <<<<<<<<<<<<<<
 *             self._set_update_hook(self.get_conn(), fn)
 *         return fn
 */
  }

  /* "sweepea.pyx":1492
 *         if not self.is_closed():
 *             self._set_update_hook(self.get_conn(), fn)
 *         return fn             # <<<<<<<<<<<<<<
 * 
 *     def _set_update_hook(self, connection, fn):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_fn);
  __pyx_r = __pyx_v_fn;
  goto __pyx_L0;

  /* "sweepea.pyx":1470
 *             sqlite3_rollback_hook(conn.db, _rollback_callback, <void *>fn)
 * 
 *     def on_update(self, fn):             # <<<<<<<<<<<<<<
 *         """
 *         Register an update hook. Hook is executed for each row that is
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("sweepea.Database.on_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1494
 *         return fn
 * 
 *     def _set_update_hook(self, connection, fn):             # <<<<<<<<<<<<<<
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_33_set_update_hook(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_8Database_33_set_update_hook(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_connection = 0;
  PyObject *__pyx_v_fn = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_set_update_hook (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_connection,&__pyx_n_s_fn,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_connection)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fn)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_set_update_hook", 1, 2, 2, 1); __PYX_ERR(0, 1494, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_set_update_hook") < 0)) __PYX_ERR(0, 1494, __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_connection = values[0];
    __pyx_v_fn = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_set_update_hook", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1494, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Database._set_update_hook", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_32_set_update_hook(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_connection, __pyx_v_fn);

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

static PyObject *__pyx_pf_7sweepea_8Database_32_set_update_hook(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_connection, PyObject *__pyx_v_fn) {
  pysqlite_Connection *__pyx_v_conn;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_set_update_hook", 0);

  /* "sweepea.pyx":1495
 * 
 *     def _set_update_hook(self, connection, fn):
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection             # <<<<<<<<<<<<<<
 *         if fn is None:
 *             sqlite3_update_hook(conn.db, NULL, NULL)
 */
  __pyx_v_conn = ((pysqlite_Connection *)__pyx_v_connection);

  /* "sweepea.pyx":1496
 *     def _set_update_hook(self, connection, fn):
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:             # <<<<<<<<<<<<<<
 *             sqlite3_update_hook(conn.db, NULL, NULL)
 *         else:
 */
  __pyx_t_1 = (__pyx_v_fn == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1497
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:
 *             sqlite3_update_hook(conn.db, NULL, NULL)             # <<<<<<<<<<<<<<
 *         else:
 *             sqlite3_update_hook(conn.db, _update_callback, <void *>fn)
 */
    sqlite3_update_hook(__pyx_v_conn->db, NULL, NULL);

    /* "sweepea.pyx":1496
 *     def _set_update_hook(self, connection, fn):
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:             # <<<<<<<<<<<<<<
 *             sqlite3_update_hook(conn.db, NULL, NULL)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1499
 *             sqlite3_update_hook(conn.db, NULL, NULL)
 *         else:
 *             sqlite3_update_hook(conn.db, _update_callback, <void *>fn)             # <<<<<<<<<<<<<<
 * 
 *     cpdef bint is_closed(self):
 */
  /*else*/ {
    sqlite3_update_hook(__pyx_v_conn->db, __pyx_f_7sweepea__update_callback, ((void *)__pyx_v_fn));
  }
  __pyx_L3:;

  /* "sweepea.pyx":1494
 *         return fn
 * 
 *     def _set_update_hook(self, connection, fn):             # <<<<<<<<<<<<<<
 *         cdef pysqlite_Connection *conn = <pysqlite_Connection *>connection
 *         if fn is None:
 */

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

/* "sweepea.pyx":1501
 *             sqlite3_update_hook(conn.db, _update_callback, <void *>fn)
 * 
 *     cpdef bint is_closed(self):             # <<<<<<<<<<<<<<
 *         """Return a boolean indicating whether the DB is closed."""
 *         return self._local.closed
 */

static PyObject *__pyx_pw_7sweepea_8Database_35is_closed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static int __pyx_f_7sweepea_8Database_is_closed(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("is_closed", 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_is_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_35is_closed)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1501, __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, 1501, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1501, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_5;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "sweepea.pyx":1503
 *     cpdef bint is_closed(self):
 *         """Return a boolean indicating whether the DB is closed."""
 *         return self._local.closed             # <<<<<<<<<<<<<<
 * 
 *     cdef get_conn(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "sweepea.pyx":1501
 *             sqlite3_update_hook(conn.db, _update_callback, <void *>fn)
 * 
 *     cpdef bint is_closed(self):             # <<<<<<<<<<<<<<
 *         """Return a boolean indicating whether the DB is closed."""
 *         return self._local.closed
 */

  /* 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_WriteUnraisable("sweepea.Database.is_closed", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_35is_closed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7sweepea_8Database_34is_closed[] = "Return a boolean indicating whether the DB is closed.";
static PyObject *__pyx_pw_7sweepea_8Database_35is_closed(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_closed (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_34is_closed(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_34is_closed(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("is_closed", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_7sweepea_8Database_is_closed(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1501, __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("sweepea.Database.is_closed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1505
 *         return self._local.closed
 * 
 *     cdef get_conn(self):             # <<<<<<<<<<<<<<
 *         # Internal method for quickly getting (or opening) a connection.
 *         if self._local.closed:
 */

static PyObject *__pyx_f_7sweepea_8Database_get_conn(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("get_conn", 0);

  /* "sweepea.pyx":1507
 *     cdef get_conn(self):
 *         # Internal method for quickly getting (or opening) a connection.
 *         if self._local.closed:             # <<<<<<<<<<<<<<
 *             self.connect()
 *         return self._local.conn
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1507, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "sweepea.pyx":1508
 *         # Internal method for quickly getting (or opening) a connection.
 *         if self._local.closed:
 *             self.connect()             # <<<<<<<<<<<<<<
 *         return self._local.conn
 * 
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->connect(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":1507
 *     cdef get_conn(self):
 *         # Internal method for quickly getting (or opening) a connection.
 *         if self._local.closed:             # <<<<<<<<<<<<<<
 *             self.connect()
 *         return self._local.conn
 */
  }

  /* "sweepea.pyx":1509
 *         if self._local.closed:
 *             self.connect()
 *         return self._local.conn             # <<<<<<<<<<<<<<
 * 
 *     cpdef execute_sql(self, sql, params=None, commit=True):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_conn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1505
 *         return self._local.closed
 * 
 *     cdef get_conn(self):             # <<<<<<<<<<<<<<
 *         # Internal method for quickly getting (or opening) a connection.
 *         if self._local.closed:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.Database.get_conn", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1511
 *         return self._local.conn
 * 
 *     cpdef execute_sql(self, sql, params=None, commit=True):             # <<<<<<<<<<<<<<
 *         """Execute the given SQL query and return the cursor."""
 *         if self._local.closed:
 */

static PyObject *__pyx_pw_7sweepea_8Database_37execute_sql(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7sweepea_8Database_execute_sql(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_sql, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_8Database_execute_sql *__pyx_optional_args) {
  PyObject *__pyx_v_params = ((PyObject *)Py_None);
  PyObject *__pyx_v_commit = ((PyObject *)Py_True);
  PyObject *__pyx_v_cursor = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("execute_sql", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_params = __pyx_optional_args->params;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_commit = __pyx_optional_args->commit;
      }
    }
  }
  /* 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_execute_sql); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_37execute_sql)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1511, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_sql);
      __Pyx_GIVEREF(__pyx_v_sql);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_sql);
      __Pyx_INCREF(__pyx_v_params);
      __Pyx_GIVEREF(__pyx_v_params);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_params);
      __Pyx_INCREF(__pyx_v_commit);
      __Pyx_GIVEREF(__pyx_v_commit);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_commit);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1511, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __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;
  }

  /* "sweepea.pyx":1513
 *     cpdef execute_sql(self, sql, params=None, commit=True):
 *         """Execute the given SQL query and return the cursor."""
 *         if self._local.closed:             # <<<<<<<<<<<<<<
 *             self.connect()
 *         cursor = self._local.conn.cursor()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_closed); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {

    /* "sweepea.pyx":1514
 *         """Execute the given SQL query and return the cursor."""
 *         if self._local.closed:
 *             self.connect()             # <<<<<<<<<<<<<<
 *         cursor = self._local.conn.cursor()
 *         cursor.execute(sql, params or ())
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->connect(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":1513
 *     cpdef execute_sql(self, sql, params=None, commit=True):
 *         """Execute the given SQL query and return the cursor."""
 *         if self._local.closed:             # <<<<<<<<<<<<<<
 *             self.connect()
 *         cursor = self._local.conn.cursor()
 */
  }

  /* "sweepea.pyx":1515
 *         if self._local.closed:
 *             self.connect()
 *         cursor = self._local.conn.cursor()             # <<<<<<<<<<<<<<
 *         cursor.execute(sql, params or ())
 *         if commit and len(self._local.transactions) == 0:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_conn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_cursor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1515, __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, 1515, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_cursor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1516
 *             self.connect()
 *         cursor = self._local.conn.cursor()
 *         cursor.execute(sql, params or ())             # <<<<<<<<<<<<<<
 *         if commit and len(self._local.transactions) == 0:
 *             self.commit()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cursor, __pyx_n_s_execute); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_params); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1516, __pyx_L1_error)
  if (!__pyx_t_7) {
  } else {
    __Pyx_INCREF(__pyx_v_params);
    __pyx_t_2 = __pyx_v_params;
    goto __pyx_L4_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_t_2 = __pyx_empty_tuple;
  __pyx_L4_bool_binop_done:;
  __pyx_t_6 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_6) {
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(__pyx_v_sql);
  __Pyx_GIVEREF(__pyx_v_sql);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_sql);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1516, __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;

  /* "sweepea.pyx":1517
 *         cursor = self._local.conn.cursor()
 *         cursor.execute(sql, params or ())
 *         if commit and len(self._local.transactions) == 0:             # <<<<<<<<<<<<<<
 *             self.commit()
 *         return cursor
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_commit); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1517, __pyx_L1_error)
  if (__pyx_t_8) {
  } else {
    __pyx_t_7 = __pyx_t_8;
    goto __pyx_L7_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_transactions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_5 == -1)) __PYX_ERR(0, 1517, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = ((__pyx_t_5 == 0) != 0);
  __pyx_t_7 = __pyx_t_8;
  __pyx_L7_bool_binop_done:;
  if (__pyx_t_7) {

    /* "sweepea.pyx":1518
 *         cursor.execute(sql, params or ())
 *         if commit and len(self._local.transactions) == 0:
 *             self.commit()             # <<<<<<<<<<<<<<
 *         return cursor
 * 
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->commit(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":1517
 *         cursor = self._local.conn.cursor()
 *         cursor.execute(sql, params or ())
 *         if commit and len(self._local.transactions) == 0:             # <<<<<<<<<<<<<<
 *             self.commit()
 *         return cursor
 */
  }

  /* "sweepea.pyx":1519
 *         if commit and len(self._local.transactions) == 0:
 *             self.commit()
 *         return cursor             # <<<<<<<<<<<<<<
 * 
 *     cpdef execute(self, query):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_cursor);
  __pyx_r = __pyx_v_cursor;
  goto __pyx_L0;

  /* "sweepea.pyx":1511
 *         return self._local.conn
 * 
 *     cpdef execute_sql(self, sql, params=None, commit=True):             # <<<<<<<<<<<<<<
 *         """Execute the given SQL query and return the cursor."""
 *         if self._local.closed:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("sweepea.Database.execute_sql", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cursor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_37execute_sql(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7sweepea_8Database_36execute_sql[] = "Execute the given SQL query and return the cursor.";
static PyObject *__pyx_pw_7sweepea_8Database_37execute_sql(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_sql = 0;
  PyObject *__pyx_v_params = 0;
  PyObject *__pyx_v_commit = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute_sql (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_sql,&__pyx_n_s_params,&__pyx_n_s_commit,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_True);
    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_sql)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_params);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_commit);
          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_sql") < 0)) __PYX_ERR(0, 1511, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_sql = values[0];
    __pyx_v_params = values[1];
    __pyx_v_commit = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute_sql", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1511, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Database.execute_sql", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_36execute_sql(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_sql, __pyx_v_params, __pyx_v_commit);

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

static PyObject *__pyx_pf_7sweepea_8Database_36execute_sql(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_params, PyObject *__pyx_v_commit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7sweepea_8Database_execute_sql __pyx_t_2;
  __Pyx_RefNannySetupContext("execute_sql", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.params = __pyx_v_params;
  __pyx_t_2.commit = __pyx_v_commit;
  __pyx_t_1 = __pyx_vtabptr_7sweepea_Database->execute_sql(__pyx_v_self, __pyx_v_sql, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1511, __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("sweepea.Database.execute_sql", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1521
 *         return cursor
 * 
 *     cpdef execute(self, query):             # <<<<<<<<<<<<<<
 *         """Execute a the SQL query represented by a Query instance."""
 *         sql, params = Context().parse(query)
 */

static PyObject *__pyx_pw_7sweepea_8Database_39execute(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static PyObject *__pyx_f_7sweepea_8Database_execute(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_query, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_sql = NULL;
  PyObject *__pyx_v_params = 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;
  struct __pyx_opt_args_7sweepea_8Database_execute_sql __pyx_t_6;
  __Pyx_RefNannySetupContext("execute", 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_execute); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_39execute)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1521, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1521, __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_query);
        __Pyx_GIVEREF(__pyx_v_query);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_query);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1521, __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;
  }

  /* "sweepea.pyx":1523
 *     cpdef execute(self, query):
 *         """Execute a the SQL query represented by a Query instance."""
 *         sql, params = Context().parse(query)             # <<<<<<<<<<<<<<
 *         return self.execute_sql(sql, params, query.commit)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea_Context), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_1)->__pyx_vtab)->parse(((struct __pyx_obj_7sweepea_Context *)__pyx_t_1), __pyx_v_query, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(__pyx_t_2 != Py_None)) {
    PyObject* sequence = __pyx_t_2;
    #if CYTHON_COMPILING_IN_CPYTHON
    Py_ssize_t size = Py_SIZE(sequence);
    #else
    Py_ssize_t size = PySequence_Size(sequence);
    #endif
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 1523, __pyx_L1_error)
    }
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
    __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1523, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 1523, __pyx_L1_error)
  }
  __pyx_v_sql = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_params = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "sweepea.pyx":1524
 *         """Execute a the SQL query represented by a Query instance."""
 *         sql, params = Context().parse(query)
 *         return self.execute_sql(sql, params, query.commit)             # <<<<<<<<<<<<<<
 * 
 *     cpdef sql(self, query):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_query, __pyx_n_s_commit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6.__pyx_n = 2;
  __pyx_t_6.params = __pyx_v_params;
  __pyx_t_6.commit = __pyx_t_2;
  __pyx_t_3 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->execute_sql(__pyx_v_self, __pyx_v_sql, 0, &__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1521
 *         return cursor
 * 
 *     cpdef execute(self, query):             # <<<<<<<<<<<<<<
 *         """Execute a the SQL query represented by a Query instance."""
 *         sql, params = Context().parse(query)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea.Database.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sql);
  __Pyx_XDECREF(__pyx_v_params);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_39execute(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static char __pyx_doc_7sweepea_8Database_38execute[] = "Execute a the SQL query represented by a Query instance.";
static PyObject *__pyx_pw_7sweepea_8Database_39execute(PyObject *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_38execute(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_query));

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

static PyObject *__pyx_pf_7sweepea_8Database_38execute(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("execute", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_8Database_execute(__pyx_v_self, __pyx_v_query, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1521, __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("sweepea.Database.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1526
 *         return self.execute_sql(sql, params, query.commit)
 * 
 *     cpdef sql(self, query):             # <<<<<<<<<<<<<<
 *         """Compile a Query object into it's SQL and parameters."""
 *         return Context().parse(query)
 */

static PyObject *__pyx_pw_7sweepea_8Database_41sql(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static PyObject *__pyx_f_7sweepea_8Database_sql(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_query, 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;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sql", 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_sql); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_41sql)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1526, __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_query);
        __Pyx_GIVEREF(__pyx_v_query);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_query);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1526, __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;
  }

  /* "sweepea.pyx":1528
 *     cpdef sql(self, query):
 *         """Compile a Query object into it's SQL and parameters."""
 *         return Context().parse(query)             # <<<<<<<<<<<<<<
 * 
 *     def pragma(self, key, value=__sentinel__):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea_Context), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_1)->__pyx_vtab)->parse(((struct __pyx_obj_7sweepea_Context *)__pyx_t_1), __pyx_v_query, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1528, __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;

  /* "sweepea.pyx":1526
 *         return self.execute_sql(sql, params, query.commit)
 * 
 *     cpdef sql(self, query):             # <<<<<<<<<<<<<<
 *         """Compile a Query object into it's SQL and parameters."""
 *         return Context().parse(query)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea.Database.sql", __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_7sweepea_8Database_41sql(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static char __pyx_doc_7sweepea_8Database_40sql[] = "Compile a Query object into it's SQL and parameters.";
static PyObject *__pyx_pw_7sweepea_8Database_41sql(PyObject *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sql (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_40sql(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_query));

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

static PyObject *__pyx_pf_7sweepea_8Database_40sql(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sql", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_8Database_sql(__pyx_v_self, __pyx_v_query, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1526, __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("sweepea.Database.sql", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1530
 *         return Context().parse(query)
 * 
 *     def pragma(self, key, value=__sentinel__):             # <<<<<<<<<<<<<<
 *         """
 *         Issue a PRAGMA query on the current connection. To query the status of
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_43pragma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7sweepea_8Database_42pragma[] = "\n        Issue a PRAGMA query on the current connection. To query the status of\n        a specific PRAGMA, typically only the key is specified. See also the\n        list of PRAGMAs which are exposed as properties on the Database.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_43pragma(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("pragma (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    values[1] = __pyx_k__46;
    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_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pragma") < 0)) __PYX_ERR(0, 1530, __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_key = values[0];
    __pyx_v_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("pragma", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1530, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Database.pragma", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_42pragma(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_7sweepea_8Database_42pragma(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_sql = NULL;
  PyObject *__pyx_v_row = 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;
  __Pyx_RefNannySetupContext("pragma", 0);

  /* "sweepea.pyx":1536
 *         list of PRAGMAs which are exposed as properties on the Database.
 *         """
 *         sql = 'PRAGMA %s' % key             # <<<<<<<<<<<<<<
 *         if value is not __sentinel__:
 *             sql += ' = %s' % value
 */
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_PRAGMA_s, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_sql = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1537
 *         """
 *         sql = 'PRAGMA %s' % key
 *         if value is not __sentinel__:             # <<<<<<<<<<<<<<
 *             sql += ' = %s' % value
 *         row = self.execute_sql(sql).fetchone()
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sentinel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_v_value != __pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "sweepea.pyx":1538
 *         sql = 'PRAGMA %s' % key
 *         if value is not __sentinel__:
 *             sql += ' = %s' % value             # <<<<<<<<<<<<<<
 *         row = self.execute_sql(sql).fetchone()
 *         if row:
 */
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s, __pyx_v_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_sql, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1538, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_sql, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "sweepea.pyx":1537
 *         """
 *         sql = 'PRAGMA %s' % key
 *         if value is not __sentinel__:             # <<<<<<<<<<<<<<
 *             sql += ' = %s' % value
 *         row = self.execute_sql(sql).fetchone()
 */
  }

  /* "sweepea.pyx":1539
 *         if value is not __sentinel__:
 *             sql += ' = %s' % value
 *         row = self.execute_sql(sql).fetchone()             # <<<<<<<<<<<<<<
 *         if row:
 *             return row[0]
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->execute_sql(__pyx_v_self, __pyx_v_sql, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fetchone); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_1) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1539, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1539, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_row = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "sweepea.pyx":1540
 *             sql += ' = %s' % value
 *         row = self.execute_sql(sql).fetchone()
 *         if row:             # <<<<<<<<<<<<<<
 *             return row[0]
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_row); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1540, __pyx_L1_error)
  if (__pyx_t_3) {

    /* "sweepea.pyx":1541
 *         row = self.execute_sql(sql).fetchone()
 *         if row:
 *             return row[0]             # <<<<<<<<<<<<<<
 * 
 *     def begin(self, lock_type=None):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_row, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "sweepea.pyx":1540
 *             sql += ' = %s' % value
 *         row = self.execute_sql(sql).fetchone()
 *         if row:             # <<<<<<<<<<<<<<
 *             return row[0]
 * 
 */
  }

  /* "sweepea.pyx":1530
 *         return Context().parse(query)
 * 
 *     def pragma(self, key, value=__sentinel__):             # <<<<<<<<<<<<<<
 *         """
 *         Issue a PRAGMA query on the current connection. To query the status of
 */

  /* 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_AddTraceback("sweepea.Database.pragma", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_sql);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1543
 *             return row[0]
 * 
 *     def begin(self, lock_type=None):             # <<<<<<<<<<<<<<
 *         """
 *         Start a transaction using the specified lock type. If the lock type is
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_45begin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7sweepea_8Database_44begin[] = "\n        Start a transaction using the specified lock type. If the lock type is\n        unspecified, then a bare BEGIN statement is used.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_45begin(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lock_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("begin (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lock_type,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lock_type);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "begin") < 0)) __PYX_ERR(0, 1543, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_lock_type = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("begin", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1543, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Database.begin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_44begin(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_lock_type);

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

static PyObject *__pyx_pf_7sweepea_8Database_44begin(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_lock_type) {
  PyObject *__pyx_v_statement = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("begin", 0);

  /* "sweepea.pyx":1548
 *         unspecified, then a bare BEGIN statement is used.
 *         """
 *         statement = 'BEGIN %s' % lock_type if lock_type else 'BEGIN'             # <<<<<<<<<<<<<<
 *         self.execute_sql(statement, commit=False)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_lock_type); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1548, __pyx_L1_error)
  if (__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_BEGIN_s, __pyx_v_lock_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_n_s_BEGIN);
    __pyx_t_1 = __pyx_n_s_BEGIN;
  }
  __pyx_v_statement = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1549
 *         """
 *         statement = 'BEGIN %s' % lock_type if lock_type else 'BEGIN'
 *         self.execute_sql(statement, commit=False)             # <<<<<<<<<<<<<<
 * 
 *     cpdef commit(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_execute_sql); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_statement);
  __Pyx_GIVEREF(__pyx_v_statement);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_statement);
  __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_commit, Py_False) < 0) __PYX_ERR(0, 1549, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":1543
 *             return row[0]
 * 
 *     def begin(self, lock_type=None):             # <<<<<<<<<<<<<<
 *         """
 *         Start a transaction using the specified lock type. If the lock type is
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea.Database.begin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_statement);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1551
 *         self.execute_sql(statement, commit=False)
 * 
 *     cpdef commit(self):             # <<<<<<<<<<<<<<
 *         """Call commit() on the pysqlite connection object."""
 *         self._local.conn.commit()
 */

static PyObject *__pyx_pw_7sweepea_8Database_47commit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7sweepea_8Database_commit(struct __pyx_obj_7sweepea_Database *__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("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, 1551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_47commit)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1551, __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, 1551, __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;
  }

  /* "sweepea.pyx":1553
 *     cpdef commit(self):
 *         """Call commit() on the pysqlite connection object."""
 *         self._local.conn.commit()             # <<<<<<<<<<<<<<
 * 
 *     cpdef rollback(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_conn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_commit); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1553, __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, 1553, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1551
 *         self.execute_sql(statement, commit=False)
 * 
 *     cpdef commit(self):             # <<<<<<<<<<<<<<
 *         """Call commit() on the pysqlite connection object."""
 *         self._local.conn.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("sweepea.Database.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_7sweepea_8Database_47commit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7sweepea_8Database_46commit[] = "Call commit() on the pysqlite connection object.";
static PyObject *__pyx_pw_7sweepea_8Database_47commit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("commit (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_46commit(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_46commit(struct __pyx_obj_7sweepea_Database *__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_7sweepea_8Database_commit(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1551, __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("sweepea.Database.commit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1555
 *         self._local.conn.commit()
 * 
 *     cpdef rollback(self):             # <<<<<<<<<<<<<<
 *         """Call rollback() on the pysqlite connection object."""
 *         self._local.conn.rollback()
 */

static PyObject *__pyx_pw_7sweepea_8Database_49rollback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7sweepea_8Database_rollback(struct __pyx_obj_7sweepea_Database *__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("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, 1555, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_49rollback)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1555, __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, 1555, __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;
  }

  /* "sweepea.pyx":1557
 *     cpdef rollback(self):
 *         """Call rollback() on the pysqlite connection object."""
 *         self._local.conn.rollback()             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, name):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_conn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_rollback); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1557, __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, 1557, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1555
 *         self._local.conn.commit()
 * 
 *     cpdef rollback(self):             # <<<<<<<<<<<<<<
 *         """Call rollback() on the pysqlite connection object."""
 *         self._local.conn.rollback()
 */

  /* 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("sweepea.Database.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_7sweepea_8Database_49rollback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7sweepea_8Database_48rollback[] = "Call rollback() on the pysqlite connection object.";
static PyObject *__pyx_pw_7sweepea_8Database_49rollback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rollback (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_48rollback(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_48rollback(struct __pyx_obj_7sweepea_Database *__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_7sweepea_8Database_rollback(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1555, __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("sweepea.Database.rollback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1559
 *         self._local.conn.rollback()
 * 
 *     def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Factory method for creating Table instances.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_51__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_7sweepea_8Database_50__getitem__[] = "\n        Factory method for creating Table instances.\n\n        Example::\n\n            UserTbl = db['users']\n            query = UserTbl.select(...)\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_7sweepea_8Database_50__getitem__;
#endif
static PyObject *__pyx_pw_7sweepea_8Database_51__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_50__getitem__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_name));

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

static PyObject *__pyx_pf_7sweepea_8Database_50__getitem__(CYTHON_UNUSED struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "sweepea.pyx":1568
 *             query = UserTbl.select(...)
 *         """
 *         return Table(name)             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1568, __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_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_name);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1568, __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;

  /* "sweepea.pyx":1559
 *         self._local.conn.rollback()
 * 
 *     def __getitem__(self, name):             # <<<<<<<<<<<<<<
 *         """
 *         Factory method for creating Table instances.
 */

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

/* "sweepea.pyx":1570
 *         return Table(name)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         self.connect()
 *         self.begin()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_53__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7sweepea_8Database_53__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_52__enter__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_52__enter__(struct __pyx_obj_7sweepea_Database *__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("__enter__", 0);

  /* "sweepea.pyx":1571
 * 
 *     def __enter__(self):
 *         self.connect()             # <<<<<<<<<<<<<<
 *         self.begin()
 *         return self
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->connect(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1572
 *     def __enter__(self):
 *         self.connect()
 *         self.begin()             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1572, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1572, __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, 1572, __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;

  /* "sweepea.pyx":1573
 *         self.connect()
 *         self.begin()
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "sweepea.pyx":1570
 *         return Table(name)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         self.connect()
 *         self.begin()
 */

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

/* "sweepea.pyx":1575
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         """
 *         Clean up the context manager, committing or rolling back and closing
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_55__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7sweepea_8Database_54__exit__[] = "\n        Clean up the context manager, committing or rolling back and closing\n        the connection.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_55__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0;
  PyObject *__pyx_v_exc_val = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_tb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_tb,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 1575, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 1575, __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, 1575, __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_type = values[0];
    __pyx_v_exc_val = values[1];
    __pyx_v_exc_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1575, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Database.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_54__exit__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_val, __pyx_v_exc_tb);

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

static PyObject *__pyx_pf_7sweepea_8Database_54__exit__(struct __pyx_obj_7sweepea_Database *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "sweepea.pyx":1580
 *         the connection.
 *         """
 *         if exc_val is not None:             # <<<<<<<<<<<<<<
 *             try:
 *                 self.rollback()
 */
  __pyx_t_1 = (__pyx_v_exc_val != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":1581
 *         """
 *         if exc_val is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 self.rollback()
 *             except:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "sweepea.pyx":1582
 *         if exc_val is not None:
 *             try:
 *                 self.rollback()             # <<<<<<<<<<<<<<
 *             except:
 *                 pass
 */
        __pyx_t_6 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->rollback(__pyx_v_self, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1582, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "sweepea.pyx":1581
 *         """
 *         if exc_val is not None:
 *             try:             # <<<<<<<<<<<<<<
 *                 self.rollback()
 *             except:
 */
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L11_try_end;
      __pyx_L4_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "sweepea.pyx":1583
 *             try:
 *                 self.rollback()
 *             except:             # <<<<<<<<<<<<<<
 *                 pass
 *         else:
 */
      /*except:*/ {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L5_exception_handled;
      }
      __pyx_L5_exception_handled:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      __pyx_L11_try_end:;
    }

    /* "sweepea.pyx":1580
 *         the connection.
 *         """
 *         if exc_val is not None:             # <<<<<<<<<<<<<<
 *             try:
 *                 self.rollback()
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1586
 *                 pass
 *         else:
 *             self.commit()             # <<<<<<<<<<<<<<
 *         if not self._local.closed:
 *             self.close()
 */
  /*else*/ {
    __pyx_t_6 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->commit(__pyx_v_self, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "sweepea.pyx":1587
 *         else:
 *             self.commit()
 *         if not self._local.closed:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_closed); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1587, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_1 = ((!__pyx_t_2) != 0);
  if (__pyx_t_1) {

    /* "sweepea.pyx":1588
 *             self.commit()
 *         if not self._local.closed:
 *             self.close()             # <<<<<<<<<<<<<<
 * 
 *     cdef _push_transaction(self, txn):
 */
    ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->close(__pyx_v_self, 0);

    /* "sweepea.pyx":1587
 *         else:
 *             self.commit()
 *         if not self._local.closed:             # <<<<<<<<<<<<<<
 *             self.close()
 * 
 */
  }

  /* "sweepea.pyx":1575
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         """
 *         Clean up the context manager, committing or rolling back and closing
 */

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

/* "sweepea.pyx":1590
 *             self.close()
 * 
 *     cdef _push_transaction(self, txn):             # <<<<<<<<<<<<<<
 *         self._local.transactions.append(txn)
 * 
 */

static PyObject *__pyx_f_7sweepea_8Database__push_transaction(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_txn) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("_push_transaction", 0);

  /* "sweepea.pyx":1591
 * 
 *     cdef _push_transaction(self, txn):
 *         self._local.transactions.append(txn)             # <<<<<<<<<<<<<<
 * 
 *     cdef _pop_transaction(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_transactions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_txn); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1590
 *             self.close()
 * 
 *     cdef _push_transaction(self, txn):             # <<<<<<<<<<<<<<
 *         self._local.transactions.append(txn)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.Database._push_transaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1593
 *         self._local.transactions.append(txn)
 * 
 *     cdef _pop_transaction(self):             # <<<<<<<<<<<<<<
 *         self._local.transactions.pop()
 * 
 */

static PyObject *__pyx_f_7sweepea_8Database__pop_transaction(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("_pop_transaction", 0);

  /* "sweepea.pyx":1594
 * 
 *     cdef _pop_transaction(self):
 *         self._local.transactions.pop()             # <<<<<<<<<<<<<<
 * 
 *     cdef _transaction_depth(self):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_transactions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Pop(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":1593
 *         self._local.transactions.append(txn)
 * 
 *     cdef _pop_transaction(self):             # <<<<<<<<<<<<<<
 *         self._local.transactions.pop()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("sweepea.Database._pop_transaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1596
 *         self._local.transactions.pop()
 * 
 *     cdef _transaction_depth(self):             # <<<<<<<<<<<<<<
 *         return len(self._local.transactions)
 * 
 */

static PyObject *__pyx_f_7sweepea_8Database__transaction_depth(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  __Pyx_RefNannySetupContext("_transaction_depth", 0);

  /* "sweepea.pyx":1597
 * 
 *     cdef _transaction_depth(self):
 *         return len(self._local.transactions)             # <<<<<<<<<<<<<<
 * 
 *     cdef last_insert_rowid(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_transactions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1596
 *         self._local.transactions.pop()
 * 
 *     cdef _transaction_depth(self):             # <<<<<<<<<<<<<<
 *         return len(self._local.transactions)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.Database._transaction_depth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1599
 *         return len(self._local.transactions)
 * 
 *     cdef last_insert_rowid(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)
 */

static PyObject *__pyx_f_7sweepea_8Database_last_insert_rowid(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  pysqlite_Connection *__pyx_v_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("last_insert_rowid", 0);

  /* "sweepea.pyx":1601
 *     cdef last_insert_rowid(self):
 *         cdef:
 *             pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)             # <<<<<<<<<<<<<<
 *         _check_connection(c)
 *         return <int>sqlite3_last_insert_rowid(c.db)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_conn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_c = ((pysqlite_Connection *)__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1602
 *         cdef:
 *             pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)
 *         _check_connection(c)             # <<<<<<<<<<<<<<
 *         return <int>sqlite3_last_insert_rowid(c.db)
 * 
 */
  __pyx_t_2 = __pyx_f_7sweepea__check_connection(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1602, __pyx_L1_error)

  /* "sweepea.pyx":1603
 *             pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)
 *         _check_connection(c)
 *         return <int>sqlite3_last_insert_rowid(c.db)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(((int)sqlite3_last_insert_rowid(__pyx_v_c->db))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1599
 *         return len(self._local.transactions)
 * 
 *     cdef last_insert_rowid(self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.Database.last_insert_rowid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1606
 * 
 *     @property
 *     def last_insert_id(self):             # <<<<<<<<<<<<<<
 *         """Return the rowid of the most-recently-inserted row."""
 *         return self.last_insert_rowid()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_14last_insert_id_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_8Database_14last_insert_id_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_14last_insert_id___get__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_14last_insert_id___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "sweepea.pyx":1608
 *     def last_insert_id(self):
 *         """Return the rowid of the most-recently-inserted row."""
 *         return self.last_insert_rowid()             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->last_insert_rowid(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1606
 * 
 *     @property
 *     def last_insert_id(self):             # <<<<<<<<<<<<<<
 *         """Return the rowid of the most-recently-inserted row."""
 *         return self.last_insert_rowid()
 */

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

/* "sweepea.pyx":1611
 * 
 *     @property
 *     def autocommit(self):             # <<<<<<<<<<<<<<
 *         """Return a boolean value indicating the status of autocommit."""
 *         cdef pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_10autocommit_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_8Database_10autocommit_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_10autocommit___get__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_10autocommit___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  pysqlite_Connection *__pyx_v_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "sweepea.pyx":1613
 *     def autocommit(self):
 *         """Return a boolean value indicating the status of autocommit."""
 *         cdef pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)             # <<<<<<<<<<<<<<
 *         _check_connection(c)
 *         return bool(sqlite3_get_autocommit(c.db))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_conn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1613, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_c = ((pysqlite_Connection *)__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1614
 *         """Return a boolean value indicating the status of autocommit."""
 *         cdef pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)
 *         _check_connection(c)             # <<<<<<<<<<<<<<
 *         return bool(sqlite3_get_autocommit(c.db))
 * 
 */
  __pyx_t_2 = __pyx_f_7sweepea__check_connection(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1614, __pyx_L1_error)

  /* "sweepea.pyx":1615
 *         cdef pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)
 *         _check_connection(c)
 *         return bool(sqlite3_get_autocommit(c.db))             # <<<<<<<<<<<<<<
 * 
 *     cdef changes(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(sqlite3_get_autocommit(__pyx_v_c->db)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __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, 1615, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong((!(!__pyx_t_3))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1611
 * 
 *     @property
 *     def autocommit(self):             # <<<<<<<<<<<<<<
 *         """Return a boolean value indicating the status of autocommit."""
 *         cdef pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)
 */

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

/* "sweepea.pyx":1617
 *         return bool(sqlite3_get_autocommit(c.db))
 * 
 *     cdef changes(self):             # <<<<<<<<<<<<<<
 *         cdef pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)
 *         _check_connection(c)
 */

static PyObject *__pyx_f_7sweepea_8Database_changes(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  pysqlite_Connection *__pyx_v_c;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("changes", 0);

  /* "sweepea.pyx":1618
 * 
 *     cdef changes(self):
 *         cdef pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)             # <<<<<<<<<<<<<<
 *         _check_connection(c)
 *         return sqlite3_changes(c.db)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_conn); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_c = ((pysqlite_Connection *)__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1619
 *     cdef changes(self):
 *         cdef pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)
 *         _check_connection(c)             # <<<<<<<<<<<<<<
 *         return sqlite3_changes(c.db)
 * 
 */
  __pyx_t_2 = __pyx_f_7sweepea__check_connection(__pyx_v_c); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 1619, __pyx_L1_error)

  /* "sweepea.pyx":1620
 *         cdef pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)
 *         _check_connection(c)
 *         return sqlite3_changes(c.db)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(sqlite3_changes(__pyx_v_c->db)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1620, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1617
 *         return bool(sqlite3_get_autocommit(c.db))
 * 
 *     cdef changes(self):             # <<<<<<<<<<<<<<
 *         cdef pysqlite_Connection *c = <pysqlite_Connection *>(self._local.conn)
 *         _check_connection(c)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.Database.changes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1623
 * 
 *     @property
 *     def rowcount(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of rows changed by the most-recently executed query.
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_8rowcount_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_8Database_8rowcount_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_8rowcount___get__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_8rowcount___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "sweepea.pyx":1627
 *         Return the number of rows changed by the most-recently executed query.
 *         """
 *         return self.changes()             # <<<<<<<<<<<<<<
 * 
 *     def set_busy_handler(self, timeout=5000):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->changes(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1623
 * 
 *     @property
 *     def rowcount(self):             # <<<<<<<<<<<<<<
 *         """
 *         Return the number of rows changed by the most-recently executed query.
 */

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

/* "sweepea.pyx":1629
 *         return self.changes()
 * 
 *     def set_busy_handler(self, timeout=5000):             # <<<<<<<<<<<<<<
 *         """
 *         Replace the default busy handler with one that introduces some "jitter"
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_57set_busy_handler(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_7sweepea_8Database_56set_busy_handler[] = "\n        Replace the default busy handler with one that introduces some \"jitter\"\n        into the amount of time delayed between checks.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_57set_busy_handler(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_timeout = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_busy_handler (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_timeout,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_5000);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_timeout);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_busy_handler") < 0)) __PYX_ERR(0, 1629, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_timeout = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_busy_handler", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1629, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Database.set_busy_handler", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Database_56set_busy_handler(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), __pyx_v_timeout);

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

static PyObject *__pyx_pf_7sweepea_8Database_56set_busy_handler(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_timeout) {
  int __pyx_v_n;
  pysqlite_Connection *__pyx_v_conn;
  sqlite3 *__pyx_v_db;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  sqlite3 *__pyx_t_3;
  __Pyx_RefNannySetupContext("set_busy_handler", 0);

  /* "sweepea.pyx":1635
 *         """
 *         cdef:
 *             int n = timeout             # <<<<<<<<<<<<<<
 *             pysqlite_Connection *conn = <pysqlite_Connection *>(self._local.conn)
 *             sqlite3 *db = conn.db
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_timeout); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1635, __pyx_L1_error)
  __pyx_v_n = __pyx_t_1;

  /* "sweepea.pyx":1636
 *         cdef:
 *             int n = timeout
 *             pysqlite_Connection *conn = <pysqlite_Connection *>(self._local.conn)             # <<<<<<<<<<<<<<
 *             sqlite3 *db = conn.db
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_local, __pyx_n_s_conn); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_conn = ((pysqlite_Connection *)__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":1637
 *             int n = timeout
 *             pysqlite_Connection *conn = <pysqlite_Connection *>(self._local.conn)
 *             sqlite3 *db = conn.db             # <<<<<<<<<<<<<<
 * 
 *         sqlite3_busy_handler(db, _aggressive_busy_handler, <void *>n)
 */
  __pyx_t_3 = __pyx_v_conn->db;
  __pyx_v_db = __pyx_t_3;

  /* "sweepea.pyx":1639
 *             sqlite3 *db = conn.db
 * 
 *         sqlite3_busy_handler(db, _aggressive_busy_handler, <void *>n)             # <<<<<<<<<<<<<<
 *         return True
 * 
 */
  sqlite3_busy_handler(__pyx_v_db, __pyx_f_7sweepea__aggressive_busy_handler, ((void *)__pyx_v_n));

  /* "sweepea.pyx":1640
 * 
 *         sqlite3_busy_handler(db, _aggressive_busy_handler, <void *>n)
 *         return True             # <<<<<<<<<<<<<<
 * 
 *     cpdef _atomic atomic(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;

  /* "sweepea.pyx":1629
 *         return self.changes()
 * 
 *     def set_busy_handler(self, timeout=5000):             # <<<<<<<<<<<<<<
 *         """
 *         Replace the default busy handler with one that introduces some "jitter"
 */

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

/* "sweepea.pyx":1642
 *         return True
 * 
 *     cpdef _atomic atomic(self):             # <<<<<<<<<<<<<<
 *         """
 *         Execute statements in either a transaction or a savepoint. The
 */

static PyObject *__pyx_pw_7sweepea_8Database_59atomic(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_7sweepea__atomic *__pyx_f_7sweepea_8Database_atomic(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_7sweepea__atomic *__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("atomic", 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_atomic); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_59atomic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1642, __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, 1642, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7sweepea__atomic))))) __PYX_ERR(0, 1642, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_7sweepea__atomic *)__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;
  }

  /* "sweepea.pyx":1657
 *             be managed for you.
 *         """
 *         return _atomic(self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _transaction transaction(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea__atomic), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((struct __pyx_obj_7sweepea__atomic *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1642
 *         return True
 * 
 *     cpdef _atomic atomic(self):             # <<<<<<<<<<<<<<
 *         """
 *         Execute statements in either a transaction or a savepoint. The
 */

  /* 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("sweepea.Database.atomic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_59atomic(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7sweepea_8Database_58atomic[] = "\n        Execute statements in either a transaction or a savepoint. The\n        outer-most call to *atomic* will use a transaction, and any subsequent\n        nested calls will use savepoints.\n\n        ``atomic`` can be used as either a context manager or a decorator.\n\n        .. note::\n            For most use-cases, it makes the most sense to always use\n            ``atomic`` when you wish to execute queries in a transaction.\n            The benefit of using ``atomic`` is that you do not need to\n            manually keep track of the transaction stack depth, as this will\n            be managed for you.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_59atomic(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("atomic (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_58atomic(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_58atomic(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("atomic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7sweepea_8Database_atomic(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1642, __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("sweepea.Database.atomic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1659
 *         return _atomic(self)
 * 
 *     cpdef _transaction transaction(self):             # <<<<<<<<<<<<<<
 *         """
 *         Execute statements in a transaction using either a context manager or
 */

static PyObject *__pyx_pw_7sweepea_8Database_61transaction(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_7sweepea__transaction *__pyx_f_7sweepea_8Database_transaction(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_7sweepea__transaction *__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("transaction", 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_transaction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_61transaction)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1659, __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, 1659, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7sweepea__transaction))))) __PYX_ERR(0, 1659, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_7sweepea__transaction *)__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;
  }

  /* "sweepea.pyx":1674
 *         function / block.
 *         """
 *         return _transaction(self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef _savepoint savepoint(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea__transaction), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((struct __pyx_obj_7sweepea__transaction *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1659
 *         return _atomic(self)
 * 
 *     cpdef _transaction transaction(self):             # <<<<<<<<<<<<<<
 *         """
 *         Execute statements in a transaction using either a context manager or
 */

  /* 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("sweepea.Database.transaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_61transaction(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7sweepea_8Database_60transaction[] = "\n        Execute statements in a transaction using either a context manager or\n        decorator. If an error is raised inside the wrapped block, the\n        transaction will be rolled back, otherwise statements are committed\n        when exiting. Transactions can also be explicitly rolled back or\n        committed within the transaction block by calling\n        :py:meth:`~transaction.rollback` or :py:meth:`~transaction.commit`.\n        If you manually commit or roll back, a new transaction will be started\n        automatically.\n\n        Nested blocks can be wrapped with ``transaction`` - the database\n        will keep a stack and only commit when it reaches the end of the outermost\n        function / block.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_61transaction(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("transaction (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_60transaction(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_60transaction(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("transaction", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7sweepea_8Database_transaction(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1659, __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("sweepea.Database.transaction", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1676
 *         return _transaction(self)
 * 
 *     cpdef _savepoint savepoint(self):             # <<<<<<<<<<<<<<
 *         """
 *         Execute statements in a savepoint using either a context manager or
 */

static PyObject *__pyx_pw_7sweepea_8Database_63savepoint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static struct __pyx_obj_7sweepea__savepoint *__pyx_f_7sweepea_8Database_savepoint(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch) {
  struct __pyx_obj_7sweepea__savepoint *__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("savepoint", 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_savepoint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1676, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_63savepoint)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1676, __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, 1676, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7sweepea__savepoint))))) __PYX_ERR(0, 1676, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_7sweepea__savepoint *)__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;
  }

  /* "sweepea.pyx":1690
 *         :param str sid: An optional string identifier for the savepoint.
 *         """
 *         return _savepoint(self)             # <<<<<<<<<<<<<<
 * 
 *     cpdef list get_tables(self):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea__savepoint), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = ((struct __pyx_obj_7sweepea__savepoint *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1676
 *         return _transaction(self)
 * 
 *     cpdef _savepoint savepoint(self):             # <<<<<<<<<<<<<<
 *         """
 *         Execute statements in a savepoint using either a context manager or
 */

  /* 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("sweepea.Database.savepoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_63savepoint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7sweepea_8Database_62savepoint[] = "\n        Execute statements in a savepoint using either a context manager or\n        decorator. If an error is raised inside the wrapped block, the\n        savepoint will be rolled back, otherwise statements are committed when\n        exiting. Like :py:meth:`~Database.transaction`, a savepoint can also\n        be explicitly rolled-back or committed by calling\n        :py:meth:`~savepoint.rollback` or :py:meth:`~savepoint.commit`. If you\n        manually commit or roll back, a new savepoint **will not** be created.\n\n        Savepoints can be thought of as nested transactions.\n\n        :param str sid: An optional string identifier for the savepoint.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_63savepoint(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("savepoint (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_62savepoint(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_62savepoint(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("savepoint", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7sweepea_8Database_savepoint(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1676, __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("sweepea.Database.savepoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1692
 *         return _savepoint(self)
 * 
 *     cpdef list get_tables(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a sorted list of tables in the database.
 */

static PyObject *__pyx_pw_7sweepea_8Database_65get_tables(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7sweepea_8Database_get_tables(struct __pyx_obj_7sweepea_Database *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_cursor = NULL;
  PyObject *__pyx_v_row = 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;
  struct __pyx_opt_args_7sweepea_8Database_execute_sql __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  __Pyx_RefNannySetupContext("get_tables", 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_get_tables); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_65get_tables)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1692, __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, 1692, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1692, __pyx_L1_error)
      __pyx_r = ((PyObject*)__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;
  }

  /* "sweepea.pyx":1696
 *         Returns a sorted list of tables in the database.
 *         """
 *         cursor = self.execute_sql('SELECT name FROM sqlite_master WHERE '             # <<<<<<<<<<<<<<
 *                                   'type = ? ORDER BY name;', ('table',))
 *         return [row[0] for row in cursor.fetchall()]
 */
  __pyx_t_5.__pyx_n = 1;
  __pyx_t_5.params = __pyx_tuple__47;
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->execute_sql(__pyx_v_self, __pyx_kp_s_SELECT_name_FROM_sqlite_master_W, 0, &__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cursor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1698
 *         cursor = self.execute_sql('SELECT name FROM sqlite_master WHERE '
 *                                   'type = ? ORDER BY name;', ('table',))
 *         return [row[0] for row in cursor.fetchall()]             # <<<<<<<<<<<<<<
 * 
 *     cpdef list get_indexes(self, table):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cursor, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1698, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1698, __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, 1698, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1698, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1698, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1698, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1698, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1698, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1698, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_row, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1698, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1698, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1692
 *         return _savepoint(self)
 * 
 *     cpdef list get_tables(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a sorted list of tables in the database.
 */

  /* 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("sweepea.Database.get_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cursor);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_65get_tables(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_7sweepea_8Database_64get_tables[] = "\n        Returns a sorted list of tables in the database.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_65get_tables(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_tables (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_64get_tables(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_64get_tables(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_tables", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_8Database_get_tables(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1692, __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("sweepea.Database.get_tables", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1700
 *         return [row[0] for row in cursor.fetchall()]
 * 
 *     cpdef list get_indexes(self, table):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of index metadata for the given table. Index metadata
 */

static PyObject *__pyx_pw_7sweepea_8Database_67get_indexes(PyObject *__pyx_v_self, PyObject *__pyx_v_table); /*proto*/
static PyObject *__pyx_f_7sweepea_8Database_get_indexes(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table, int __pyx_skip_dispatch) {
  int __pyx_v_is_unique;
  PyObject *__pyx_v_index_columns = 0;
  PyObject *__pyx_v_index_to_sql = 0;
  PyObject *__pyx_v_unique_indexes = 0;
  PyObject *__pyx_v_query = NULL;
  PyObject *__pyx_v_cursor = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_name = NULL;
  PyObject *__pyx_v_index_name = 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;
  struct __pyx_opt_args_7sweepea_8Database_execute_sql __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("get_indexes", 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_get_indexes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1700, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_67get_indexes)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1700, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1700, __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_table);
        __Pyx_GIVEREF(__pyx_v_table);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_table);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1700, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1700, __pyx_L1_error)
      __pyx_r = ((PyObject*)__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;
  }

  /* "sweepea.pyx":1712
 *         cdef:
 *             bint is_unique
 *             dict index_columns = {}, index_to_sql             # <<<<<<<<<<<<<<
 *             set unique_indexes = set()
 * 
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_index_columns = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1713
 *             bint is_unique
 *             dict index_columns = {}, index_to_sql
 *             set unique_indexes = set()             # <<<<<<<<<<<<<<
 * 
 *         query = ('SELECT name, sql FROM sqlite_master '
 */
  __pyx_t_1 = PySet_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_unique_indexes = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1715
 *             set unique_indexes = set()
 * 
 *         query = ('SELECT name, sql FROM sqlite_master '             # <<<<<<<<<<<<<<
 *                  'WHERE tbl_name = ? AND type = ? ORDER BY name')
 *         cursor = self.execute_sql(query, (table, 'index'))
 */
  __Pyx_INCREF(__pyx_kp_s_SELECT_name_sql_FROM_sqlite_mast);
  __pyx_v_query = __pyx_kp_s_SELECT_name_sql_FROM_sqlite_mast;

  /* "sweepea.pyx":1717
 *         query = ('SELECT name, sql FROM sqlite_master '
 *                  'WHERE tbl_name = ? AND type = ? ORDER BY name')
 *         cursor = self.execute_sql(query, (table, 'index'))             # <<<<<<<<<<<<<<
 *         index_to_sql = dict(cursor.fetchall())
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_table);
  __Pyx_GIVEREF(__pyx_v_table);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_table);
  __Pyx_INCREF(__pyx_n_s_index);
  __Pyx_GIVEREF(__pyx_n_s_index);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_index);
  __pyx_t_6.__pyx_n = 1;
  __pyx_t_6.params = __pyx_t_1;
  __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->execute_sql(__pyx_v_self, __pyx_v_query, 0, &__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cursor = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "sweepea.pyx":1718
 *                  'WHERE tbl_name = ? AND type = ? ORDER BY name')
 *         cursor = self.execute_sql(query, (table, 'index'))
 *         index_to_sql = dict(cursor.fetchall())             # <<<<<<<<<<<<<<
 * 
 *         # Determine which indexes have a unique constraint.
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_cursor, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1718, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1718, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyDict_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_index_to_sql = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "sweepea.pyx":1721
 * 
 *         # Determine which indexes have a unique constraint.
 *         cursor = self.execute_sql('PRAGMA index_list("%s")' % table)             # <<<<<<<<<<<<<<
 *         for row in cursor.fetchall():
 *             name = row[1]
 */
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_PRAGMA_index_list_s, __pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->execute_sql(__pyx_v_self, __pyx_t_2, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1721, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_cursor, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1722
 *         # Determine which indexes have a unique constraint.
 *         cursor = self.execute_sql('PRAGMA index_list("%s")' % table)
 *         for row in cursor.fetchall():             # <<<<<<<<<<<<<<
 *             name = row[1]
 *             is_unique = int(row[2]) == 1
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_cursor, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1722, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __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, 1722, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1722, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1722, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1722, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1722, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_8(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        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, 1722, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "sweepea.pyx":1723
 *         cursor = self.execute_sql('PRAGMA index_list("%s")' % table)
 *         for row in cursor.fetchall():
 *             name = row[1]             # <<<<<<<<<<<<<<
 *             is_unique = int(row[2]) == 1
 *             if is_unique:
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_row, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "sweepea.pyx":1724
 *         for row in cursor.fetchall():
 *             name = row[1]
 *             is_unique = int(row[2]) == 1             # <<<<<<<<<<<<<<
 *             if is_unique:
 *                 unique_indexes.add(name)
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_row, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1724, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_is_unique = __pyx_t_9;

    /* "sweepea.pyx":1725
 *             name = row[1]
 *             is_unique = int(row[2]) == 1
 *             if is_unique:             # <<<<<<<<<<<<<<
 *                 unique_indexes.add(name)
 * 
 */
    __pyx_t_9 = (__pyx_v_is_unique != 0);
    if (__pyx_t_9) {

      /* "sweepea.pyx":1726
 *             is_unique = int(row[2]) == 1
 *             if is_unique:
 *                 unique_indexes.add(name)             # <<<<<<<<<<<<<<
 * 
 *         # Retrieve the indexed columns.
 */
      __pyx_t_10 = PySet_Add(__pyx_v_unique_indexes, __pyx_v_name); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1726, __pyx_L1_error)

      /* "sweepea.pyx":1725
 *             name = row[1]
 *             is_unique = int(row[2]) == 1
 *             if is_unique:             # <<<<<<<<<<<<<<
 *                 unique_indexes.add(name)
 * 
 */
    }

    /* "sweepea.pyx":1722
 *         # Determine which indexes have a unique constraint.
 *         cursor = self.execute_sql('PRAGMA index_list("%s")' % table)
 *         for row in cursor.fetchall():             # <<<<<<<<<<<<<<
 *             name = row[1]
 *             is_unique = int(row[2]) == 1
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":1729
 * 
 *         # Retrieve the indexed columns.
 *         for index_name in sorted(index_to_sql):             # <<<<<<<<<<<<<<
 *             cursor = self.execute_sql('PRAGMA index_info("%s")' % index_name)
 *             index_columns[index_name] = [row[2] for row in cursor.fetchall()]
 */
  __pyx_t_1 = PySequence_List(__pyx_v_index_to_sql); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_10 = PyList_Sort(__pyx_t_2); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1729, __pyx_L1_error)
  if (unlikely(__pyx_t_2 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 1729, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1729, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1729, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_index_name, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "sweepea.pyx":1730
 *         # Retrieve the indexed columns.
 *         for index_name in sorted(index_to_sql):
 *             cursor = self.execute_sql('PRAGMA index_info("%s")' % index_name)             # <<<<<<<<<<<<<<
 *             index_columns[index_name] = [row[2] for row in cursor.fetchall()]
 * 
 */
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_PRAGMA_index_info_s, __pyx_v_index_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->execute_sql(__pyx_v_self, __pyx_t_2, 0, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1730, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_cursor, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "sweepea.pyx":1731
 *         for index_name in sorted(index_to_sql):
 *             cursor = self.execute_sql('PRAGMA index_info("%s")' % index_name)
 *             index_columns[index_name] = [row[2] for row in cursor.fetchall()]             # <<<<<<<<<<<<<<
 * 
 *         return [(
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_cursor, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1731, __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, 1731, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_11 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_11 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1731, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1731, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1731, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1731, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 1731, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1731, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_8(__pyx_t_5);
        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, 1731, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_row, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1731, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 1731, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(PyDict_SetItem(__pyx_v_index_columns, __pyx_v_index_name, __pyx_t_3) < 0)) __PYX_ERR(0, 1731, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "sweepea.pyx":1729
 * 
 *         # Retrieve the indexed columns.
 *         for index_name in sorted(index_to_sql):             # <<<<<<<<<<<<<<
 *             cursor = self.execute_sql('PRAGMA index_info("%s")' % index_name)
 *             index_columns[index_name] = [row[2] for row in cursor.fetchall()]
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1733
 *             index_columns[index_name] = [row[2] for row in cursor.fetchall()]
 * 
 *         return [(             # <<<<<<<<<<<<<<
 *             name,
 *             index_to_sql[name],
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1733, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "sweepea.pyx":1738
 *             index_columns[name],
 *             name in unique_indexes)
 *             for name in sorted(index_to_sql)]             # <<<<<<<<<<<<<<
 * 
 *     cpdef list get_columns(self, table):
 */
  __pyx_t_5 = PySequence_List(__pyx_v_index_to_sql); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_10 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1738, __pyx_L1_error)
  if (unlikely(__pyx_t_3 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(0, 1738, __pyx_L1_error)
  }
  __pyx_t_5 = __pyx_t_3; __Pyx_INCREF(__pyx_t_5); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_5)) break;
    #if CYTHON_COMPILING_IN_CPYTHON
    __pyx_t_3 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1738, __pyx_L1_error)
    #else
    __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_name, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "sweepea.pyx":1735
 *         return [(
 *             name,
 *             index_to_sql[name],             # <<<<<<<<<<<<<<
 *             index_columns[name],
 *             name in unique_indexes)
 */
    __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_index_to_sql, __pyx_v_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "sweepea.pyx":1736
 *             name,
 *             index_to_sql[name],
 *             index_columns[name],             # <<<<<<<<<<<<<<
 *             name in unique_indexes)
 *             for name in sorted(index_to_sql)]
 */
    __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_index_columns, __pyx_v_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "sweepea.pyx":1737
 *             index_to_sql[name],
 *             index_columns[name],
 *             name in unique_indexes)             # <<<<<<<<<<<<<<
 *             for name in sorted(index_to_sql)]
 * 
 */
    __pyx_t_9 = (__Pyx_PySequence_ContainsTF(__pyx_v_name, __pyx_v_unique_indexes, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1737, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);

    /* "sweepea.pyx":1734
 * 
 *         return [(
 *             name,             # <<<<<<<<<<<<<<
 *             index_to_sql[name],
 *             index_columns[name],
 */
    __pyx_t_12 = PyTuple_New(4); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_name);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_t_4);
    __pyx_t_3 = 0;
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_12))) __PYX_ERR(0, 1733, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

    /* "sweepea.pyx":1738
 *             index_columns[name],
 *             name in unique_indexes)
 *             for name in sorted(index_to_sql)]             # <<<<<<<<<<<<<<
 * 
 *     cpdef list get_columns(self, table):
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1700
 *         return [row[0] for row in cursor.fetchall()]
 * 
 *     cpdef list get_indexes(self, table):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of index metadata for the given table. Index metadata
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("sweepea.Database.get_indexes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_index_columns);
  __Pyx_XDECREF(__pyx_v_index_to_sql);
  __Pyx_XDECREF(__pyx_v_unique_indexes);
  __Pyx_XDECREF(__pyx_v_query);
  __Pyx_XDECREF(__pyx_v_cursor);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_name);
  __Pyx_XDECREF(__pyx_v_index_name);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_67get_indexes(PyObject *__pyx_v_self, PyObject *__pyx_v_table); /*proto*/
static char __pyx_doc_7sweepea_8Database_66get_indexes[] = "\n        Returns a list of index metadata for the given table. Index metadata\n        is returned as a 4-tuple consisting of:\n\n        * Index name.\n        * SQL used to create the index.\n        * Names of columns being indexed.\n        * Whether the index is unique.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_67get_indexes(PyObject *__pyx_v_self, PyObject *__pyx_v_table) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_indexes (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_66get_indexes(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_table));

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

static PyObject *__pyx_pf_7sweepea_8Database_66get_indexes(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_indexes", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_8Database_get_indexes(__pyx_v_self, __pyx_v_table, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1700, __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("sweepea.Database.get_indexes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1740
 *             for name in sorted(index_to_sql)]
 * 
 *     cpdef list get_columns(self, table):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of column metadata for the given table. Column
 */

static PyObject *__pyx_pw_7sweepea_8Database_69get_columns(PyObject *__pyx_v_self, PyObject *__pyx_v_table); /*proto*/
static PyObject *__pyx_f_7sweepea_8Database_get_columns(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_cursor = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("get_columns", 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_get_columns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_69get_columns)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1740, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1740, __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_table);
        __Pyx_GIVEREF(__pyx_v_table);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_table);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1740, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1740, __pyx_L1_error)
      __pyx_r = ((PyObject*)__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;
  }

  /* "sweepea.pyx":1750
 *         * Whether the column is the primary key.
 *         """
 *         cursor = self.execute_sql('PRAGMA table_info("%s")' % table)             # <<<<<<<<<<<<<<
 *         return [(row[1], row[2], not row[3], bool(row[5]))
 *                 for row in cursor.fetchall()]
 */
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_PRAGMA_table_info_s, __pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->execute_sql(__pyx_v_self, __pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cursor = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "sweepea.pyx":1751
 *         """
 *         cursor = self.execute_sql('PRAGMA table_info("%s")' % table)
 *         return [(row[1], row[2], not row[3], bool(row[5]))             # <<<<<<<<<<<<<<
 *                 for row in cursor.fetchall()]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "sweepea.pyx":1752
 *         cursor = self.execute_sql('PRAGMA table_info("%s")' % table)
 *         return [(row[1], row[2], not row[3], bool(row[5]))
 *                 for row in cursor.fetchall()]             # <<<<<<<<<<<<<<
 * 
 *     cpdef list get_primary_keys(self, table):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cursor, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1752, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1752, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1752, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1752, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1752, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1752, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1752, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1752, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1752, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        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, 1752, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "sweepea.pyx":1751
 *         """
 *         cursor = self.execute_sql('PRAGMA table_info("%s")' % table)
 *         return [(row[1], row[2], not row[3], bool(row[5]))             # <<<<<<<<<<<<<<
 *                 for row in cursor.fetchall()]
 * 
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_row, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_row, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_row, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1751, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyBool_FromLong((!__pyx_t_8)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_GetItemInt(__pyx_v_row, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1751, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_9 = __Pyx_PyBool_FromLong((!(!__pyx_t_8))); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyTuple_New(4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_10, 3, __pyx_t_9);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_4 = 0;
    __pyx_t_9 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 1751, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "sweepea.pyx":1752
 *         cursor = self.execute_sql('PRAGMA table_info("%s")' % table)
 *         return [(row[1], row[2], not row[3], bool(row[5]))
 *                 for row in cursor.fetchall()]             # <<<<<<<<<<<<<<
 * 
 *     cpdef list get_primary_keys(self, table):
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1740
 *             for name in sorted(index_to_sql)]
 * 
 *     cpdef list get_columns(self, table):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of column metadata for the given table. Column
 */

  /* 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_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("sweepea.Database.get_columns", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cursor);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_69get_columns(PyObject *__pyx_v_self, PyObject *__pyx_v_table); /*proto*/
static char __pyx_doc_7sweepea_8Database_68get_columns[] = "\n        Returns a list of column metadata for the given table. Column\n        metadata is returned as a 4-tuple consisting of:\n\n        * Column name.\n        * Data-type column was declared with.\n        * Whether the column can be NULL.\n        * Whether the column is the primary key.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_69get_columns(PyObject *__pyx_v_self, PyObject *__pyx_v_table) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_columns (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_68get_columns(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_table));

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

static PyObject *__pyx_pf_7sweepea_8Database_68get_columns(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_columns", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_8Database_get_columns(__pyx_v_self, __pyx_v_table, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1740, __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("sweepea.Database.get_columns", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1754
 *                 for row in cursor.fetchall()]
 * 
 *     cpdef list get_primary_keys(self, table):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of column(s) that comprise the table's foreign key.
 */

static PyObject *__pyx_pw_7sweepea_8Database_71get_primary_keys(PyObject *__pyx_v_self, PyObject *__pyx_v_table); /*proto*/
static PyObject *__pyx_f_7sweepea_8Database_get_primary_keys(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_cursor = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("get_primary_keys", 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_get_primary_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1754, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_71get_primary_keys)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1754, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1754, __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_table);
        __Pyx_GIVEREF(__pyx_v_table);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_table);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1754, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1754, __pyx_L1_error)
      __pyx_r = ((PyObject*)__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;
  }

  /* "sweepea.pyx":1758
 *         Returns a list of column(s) that comprise the table's foreign key.
 *         """
 *         cursor = self.execute_sql('PRAGMA table_info("%s")' % table)             # <<<<<<<<<<<<<<
 *         return [row[1] for row in cursor.fetchall() if row[-1]]
 * 
 */
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_PRAGMA_table_info_s, __pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->execute_sql(__pyx_v_self, __pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cursor = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "sweepea.pyx":1759
 *         """
 *         cursor = self.execute_sql('PRAGMA table_info("%s")' % table)
 *         return [row[1] for row in cursor.fetchall() if row[-1]]             # <<<<<<<<<<<<<<
 * 
 *     cpdef list get_foreign_keys(self, table):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cursor, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1759, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1759, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1759, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1759, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1759, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1759, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1759, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1759, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        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, 1759, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_row, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1759, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1759, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_8) {
      __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_row, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 1759, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1754
 *                 for row in cursor.fetchall()]
 * 
 *     cpdef list get_primary_keys(self, table):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of column(s) that comprise the table's foreign key.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea.Database.get_primary_keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cursor);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_71get_primary_keys(PyObject *__pyx_v_self, PyObject *__pyx_v_table); /*proto*/
static char __pyx_doc_7sweepea_8Database_70get_primary_keys[] = "\n        Returns a list of column(s) that comprise the table's foreign key.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_71get_primary_keys(PyObject *__pyx_v_self, PyObject *__pyx_v_table) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_primary_keys (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_70get_primary_keys(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_table));

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

static PyObject *__pyx_pf_7sweepea_8Database_70get_primary_keys(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_primary_keys", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_8Database_get_primary_keys(__pyx_v_self, __pyx_v_table, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1754, __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("sweepea.Database.get_primary_keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1761
 *         return [row[1] for row in cursor.fetchall() if row[-1]]
 * 
 *     cpdef list get_foreign_keys(self, table):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of foreign key metadata for the given table. Foreign
 */

static PyObject *__pyx_pw_7sweepea_8Database_73get_foreign_keys(PyObject *__pyx_v_self, PyObject *__pyx_v_table); /*proto*/
static PyObject *__pyx_f_7sweepea_8Database_get_foreign_keys(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_cursor = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("get_foreign_keys", 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_get_foreign_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1761, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_8Database_73get_foreign_keys)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1761, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1761, __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_table);
        __Pyx_GIVEREF(__pyx_v_table);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_table);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1761, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 1761, __pyx_L1_error)
      __pyx_r = ((PyObject*)__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;
  }

  /* "sweepea.pyx":1770
 *         * Destination column.
 *         """
 *         cursor = self.execute_sql('PRAGMA foreign_key_list("%s")' % table)             # <<<<<<<<<<<<<<
 *         return [(row[3], row[2], row[4]) for row in cursor.fetchall()]
 * 
 */
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_PRAGMA_foreign_key_list_s, __pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->__pyx_vtab)->execute_sql(__pyx_v_self, __pyx_t_1, 0, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_cursor = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "sweepea.pyx":1771
 *         """
 *         cursor = self.execute_sql('PRAGMA foreign_key_list("%s")' % table)
 *         return [(row[3], row[2], row[4]) for row in cursor.fetchall()]             # <<<<<<<<<<<<<<
 * 
 *     # Pragma queries.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cursor, __pyx_n_s_fetchall); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1771, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1771, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1771, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1771, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1771, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1771, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 1771, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1771, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_1)) {
        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, 1771, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_row, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_row, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_row, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_4);
    __pyx_t_1 = 0;
    __pyx_t_5 = 0;
    __pyx_t_4 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 1771, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1761
 *         return [row[1] for row in cursor.fetchall() if row[-1]]
 * 
 *     cpdef list get_foreign_keys(self, table):             # <<<<<<<<<<<<<<
 *         """
 *         Returns a list of foreign key metadata for the given table. Foreign
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("sweepea.Database.get_foreign_keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cursor);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_73get_foreign_keys(PyObject *__pyx_v_self, PyObject *__pyx_v_table); /*proto*/
static char __pyx_doc_7sweepea_8Database_72get_foreign_keys[] = "\n        Returns a list of foreign key metadata for the given table. Foreign\n        key metadata is returned as a 3-tuple consisting of:\n\n        * Source column name, i.e. the column on the given table.\n        * Destination table.\n        * Destination column.\n        ";
static PyObject *__pyx_pw_7sweepea_8Database_73get_foreign_keys(PyObject *__pyx_v_self, PyObject *__pyx_v_table) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_foreign_keys (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_72get_foreign_keys(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_table));

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

static PyObject *__pyx_pf_7sweepea_8Database_72get_foreign_keys(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_table) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("get_foreign_keys", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_8Database_get_foreign_keys(__pyx_v_self, __pyx_v_table, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1761, __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("sweepea.Database.get_foreign_keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1162
 *         object _lock
 *         object _commit_hook, _rollback_hook, _update_hook
 *         public dict connect_kwargs             # <<<<<<<<<<<<<<
 *         public list _pragmas
 *         public object database
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_14connect_kwargs_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_8Database_14connect_kwargs_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_14connect_kwargs___get__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_14connect_kwargs___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->connect_kwargs);
  __pyx_r = __pyx_v_self->connect_kwargs;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_8Database_14connect_kwargs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7sweepea_8Database_14connect_kwargs_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_14connect_kwargs_2__set__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7sweepea_8Database_14connect_kwargs_2__set__(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyDict_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1162, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->connect_kwargs);
  __Pyx_DECREF(__pyx_v_self->connect_kwargs);
  __pyx_v_self->connect_kwargs = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_8Database_14connect_kwargs_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7sweepea_8Database_14connect_kwargs_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_14connect_kwargs_4__del__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static int __pyx_pf_7sweepea_8Database_14connect_kwargs_4__del__(struct __pyx_obj_7sweepea_Database *__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->connect_kwargs);
  __Pyx_DECREF(__pyx_v_self->connect_kwargs);
  __pyx_v_self->connect_kwargs = ((PyObject*)Py_None);

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

/* "sweepea.pyx":1163
 *         object _commit_hook, _rollback_hook, _update_hook
 *         public dict connect_kwargs
 *         public list _pragmas             # <<<<<<<<<<<<<<
 *         public object database
 *         readonly bint deferred
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_8_pragmas_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_8Database_8_pragmas_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_8_pragmas___get__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_8_pragmas___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_pragmas);
  __pyx_r = __pyx_v_self->_pragmas;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_8Database_8_pragmas_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7sweepea_8Database_8_pragmas_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_8_pragmas_2__set__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7sweepea_8Database_8_pragmas_2__set__(struct __pyx_obj_7sweepea_Database *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1163, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_pragmas);
  __Pyx_DECREF(__pyx_v_self->_pragmas);
  __pyx_v_self->_pragmas = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_8Database_8_pragmas_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7sweepea_8Database_8_pragmas_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_8_pragmas_4__del__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static int __pyx_pf_7sweepea_8Database_8_pragmas_4__del__(struct __pyx_obj_7sweepea_Database *__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->_pragmas);
  __Pyx_DECREF(__pyx_v_self->_pragmas);
  __pyx_v_self->_pragmas = ((PyObject*)Py_None);

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

/* "sweepea.pyx":1164
 *         public dict connect_kwargs
 *         public list _pragmas
 *         public object database             # <<<<<<<<<<<<<<
 *         readonly bint deferred
 *         readonly object _local
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_8database_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_8Database_8database_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_8database___get__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_8database___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->database);
  __pyx_r = __pyx_v_self->database;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_8Database_8database_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7sweepea_8Database_8database_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_8database_2__set__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7sweepea_8Database_8database_2__set__(struct __pyx_obj_7sweepea_Database *__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->database);
  __Pyx_DECREF(__pyx_v_self->database);
  __pyx_v_self->database = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_8Database_8database_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7sweepea_8Database_8database_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_8database_4__del__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static int __pyx_pf_7sweepea_8Database_8database_4__del__(struct __pyx_obj_7sweepea_Database *__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->database);
  __Pyx_DECREF(__pyx_v_self->database);
  __pyx_v_self->database = Py_None;

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

/* "sweepea.pyx":1165
 *         public list _pragmas
 *         public object database
 *         readonly bint deferred             # <<<<<<<<<<<<<<
 *         readonly object _local
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_8deferred_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_8Database_8deferred_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_8deferred___get__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_8deferred___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_v_self->deferred); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __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("sweepea.Database.deferred.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1166
 *         public object database
 *         readonly bint deferred
 *         readonly object _local             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, database, pragmas=None, journal_mode=None,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Database_6_local_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_8Database_6_local_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_8Database_6_local___get__(((struct __pyx_obj_7sweepea_Database *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_8Database_6_local___get__(struct __pyx_obj_7sweepea_Database *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_local);
  __pyx_r = __pyx_v_self->_local;
  goto __pyx_L0;

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

/* "sweepea.pyx":1816
 *         object _helper
 * 
 *     def __init__(self, Database db):             # <<<<<<<<<<<<<<
 *         self.db = db
 * 
 */

/* Python wrapper */
static int __pyx_pw_7sweepea_7_atomic_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7sweepea_7_atomic_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7sweepea_Database *__pyx_v_db = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_db,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) {
        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_db)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1816, __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_db = ((struct __pyx_obj_7sweepea_Database *)values[0]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1816, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea._atomic.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_db), __pyx_ptype_7sweepea_Database, 1, "db", 0))) __PYX_ERR(0, 1816, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_7_atomic___init__(((struct __pyx_obj_7sweepea__atomic *)__pyx_v_self), __pyx_v_db);

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

static int __pyx_pf_7sweepea_7_atomic___init__(struct __pyx_obj_7sweepea__atomic *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_db) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":1817
 * 
 *     def __init__(self, Database db):
 *         self.db = db             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_db));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_db));
  __Pyx_GOTREF(__pyx_v_self->db);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->db));
  __pyx_v_self->db = __pyx_v_db;

  /* "sweepea.pyx":1816
 *         object _helper
 * 
 *     def __init__(self, Database db):             # <<<<<<<<<<<<<<
 *         self.db = db
 * 
 */

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

/* "sweepea.pyx":1819
 *         self.db = db
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         if self.db._transaction_depth() == 0:
 *             self._helper = self.db.transaction()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7_atomic_3__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7sweepea_7_atomic_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_7sweepea_7_atomic_2__enter__(((struct __pyx_obj_7sweepea__atomic *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_7_atomic_2__enter__(struct __pyx_obj_7sweepea__atomic *__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;
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "sweepea.pyx":1820
 * 
 *     def __enter__(self):
 *         if self.db._transaction_depth() == 0:             # <<<<<<<<<<<<<<
 *             self._helper = self.db.transaction()
 *         else:
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->db->__pyx_vtab)->_transaction_depth(__pyx_v_self->db); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1820, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "sweepea.pyx":1821
 *     def __enter__(self):
 *         if self.db._transaction_depth() == 0:
 *             self._helper = self.db.transaction()             # <<<<<<<<<<<<<<
 *         else:
 *             self._helper = self.db.savepoint()
 */
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->db->__pyx_vtab)->transaction(__pyx_v_self->db, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1821, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_helper);
    __Pyx_DECREF(__pyx_v_self->_helper);
    __pyx_v_self->_helper = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "sweepea.pyx":1820
 * 
 *     def __enter__(self):
 *         if self.db._transaction_depth() == 0:             # <<<<<<<<<<<<<<
 *             self._helper = self.db.transaction()
 *         else:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1823
 *             self._helper = self.db.transaction()
 *         else:
 *             self._helper = self.db.savepoint()             # <<<<<<<<<<<<<<
 *         return self._helper.__enter__()
 * 
 */
  /*else*/ {
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->db->__pyx_vtab)->savepoint(__pyx_v_self->db, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_self->_helper);
    __Pyx_DECREF(__pyx_v_self->_helper);
    __pyx_v_self->_helper = __pyx_t_2;
    __pyx_t_2 = 0;
  }
  __pyx_L3:;

  /* "sweepea.pyx":1824
 *         else:
 *             self._helper = self.db.savepoint()
 *         return self._helper.__enter__()             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_helper, __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1824, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1824, __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;

  /* "sweepea.pyx":1819
 *         self.db = db
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         if self.db._transaction_depth() == 0:
 *             self._helper = self.db.transaction()
 */

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

/* "sweepea.pyx":1826
 *         return self._helper.__enter__()
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         return self._helper.__exit__(exc_type, exc_val, exc_tb)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7_atomic_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_7_atomic_5__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_exc_type = 0;
  PyObject *__pyx_v_exc_val = 0;
  PyObject *__pyx_v_exc_tb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_tb,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 1826, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 1826, __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, 1826, __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_type = values[0];
    __pyx_v_exc_val = values[1];
    __pyx_v_exc_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1826, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea._atomic.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_7_atomic_4__exit__(((struct __pyx_obj_7sweepea__atomic *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_val, __pyx_v_exc_tb);

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

static PyObject *__pyx_pf_7sweepea_7_atomic_4__exit__(struct __pyx_obj_7sweepea__atomic *__pyx_v_self, PyObject *__pyx_v_exc_type, PyObject *__pyx_v_exc_val, PyObject *__pyx_v_exc_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "sweepea.pyx":1827
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 *         return self._helper.__exit__(exc_type, exc_val, exc_tb)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_helper, __pyx_n_s_exit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_exc_type);
  __Pyx_GIVEREF(__pyx_v_exc_type);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_exc_type);
  __Pyx_INCREF(__pyx_v_exc_val);
  __Pyx_GIVEREF(__pyx_v_exc_val);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_exc_val);
  __Pyx_INCREF(__pyx_v_exc_tb);
  __Pyx_GIVEREF(__pyx_v_exc_tb);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_exc_tb);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1827, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1826
 *         return self._helper.__enter__()
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         return self._helper.__exit__(exc_type, exc_val, exc_tb)
 * 
 */

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

/* "sweepea.pyx":1836
 *         Database db
 * 
 *     def __init__(self, Database db, lock='DEFERRED'):             # <<<<<<<<<<<<<<
 *         self.db = db
 *         self.lock = lock
 */

/* Python wrapper */
static int __pyx_pw_7sweepea_12_transaction_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7sweepea_12_transaction_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7sweepea_Database *__pyx_v_db = 0;
  PyObject *__pyx_v_lock = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_db,&__pyx_n_s_lock,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)__pyx_n_s_DEFERRED);
    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_db)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lock);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1836, __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_db = ((struct __pyx_obj_7sweepea_Database *)values[0]);
    __pyx_v_lock = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1836, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea._transaction.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_db), __pyx_ptype_7sweepea_Database, 1, "db", 0))) __PYX_ERR(0, 1836, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_12_transaction___init__(((struct __pyx_obj_7sweepea__transaction *)__pyx_v_self), __pyx_v_db, __pyx_v_lock);

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

static int __pyx_pf_7sweepea_12_transaction___init__(struct __pyx_obj_7sweepea__transaction *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_db, PyObject *__pyx_v_lock) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":1837
 * 
 *     def __init__(self, Database db, lock='DEFERRED'):
 *         self.db = db             # <<<<<<<<<<<<<<
 *         self.lock = lock
 * 
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_db));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_db));
  __Pyx_GOTREF(__pyx_v_self->db);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->db));
  __pyx_v_self->db = __pyx_v_db;

  /* "sweepea.pyx":1838
 *     def __init__(self, Database db, lock='DEFERRED'):
 *         self.db = db
 *         self.lock = lock             # <<<<<<<<<<<<<<
 * 
 *     cpdef _begin(self):
 */
  if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_v_lock))||((__pyx_v_lock) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_v_lock)->tp_name), 0))) __PYX_ERR(0, 1838, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_lock;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->lock);
  __Pyx_DECREF(__pyx_v_self->lock);
  __pyx_v_self->lock = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1836
 *         Database db
 * 
 *     def __init__(self, Database db, lock='DEFERRED'):             # <<<<<<<<<<<<<<
 *         self.db = db
 *         self.lock = lock
 */

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

/* "sweepea.pyx":1840
 *         self.lock = lock
 * 
 *     cpdef _begin(self):             # <<<<<<<<<<<<<<
 *         self.db.begin(self.lock)
 * 
 */

static PyObject *__pyx_pw_7sweepea_12_transaction_3_begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7sweepea_12_transaction__begin(struct __pyx_obj_7sweepea__transaction *__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("_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_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_12_transaction_3_begin)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1840, __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, 1840, __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;
  }

  /* "sweepea.pyx":1841
 * 
 *     cpdef _begin(self):
 *         self.db.begin(self.lock)             # <<<<<<<<<<<<<<
 * 
 *     cpdef commit(self, bint begin=True):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->db), __pyx_n_s_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self->lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1841, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1841, __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_self->lock);
    __Pyx_GIVEREF(__pyx_v_self->lock);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self->lock);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1841, __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;

  /* "sweepea.pyx":1840
 *         self.lock = lock
 * 
 *     cpdef _begin(self):             # <<<<<<<<<<<<<<
 *         self.db.begin(self.lock)
 * 
 */

  /* 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("sweepea._transaction._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_7sweepea_12_transaction_3_begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7sweepea_12_transaction_3_begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_begin (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_12_transaction_2_begin(((struct __pyx_obj_7sweepea__transaction *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_12_transaction_2_begin(struct __pyx_obj_7sweepea__transaction *__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_7sweepea_12_transaction__begin(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1840, __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("sweepea._transaction._begin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1843
 *         self.db.begin(self.lock)
 * 
 *     cpdef commit(self, bint begin=True):             # <<<<<<<<<<<<<<
 *         self.db.commit()
 *         if begin:
 */

static PyObject *__pyx_pw_7sweepea_12_transaction_5commit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7sweepea_12_transaction_commit(struct __pyx_obj_7sweepea__transaction *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_12_transaction_commit *__pyx_optional_args) {
  int __pyx_v_begin = ((int)1);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("commit", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_begin = __pyx_optional_args->begin;
    }
  }
  /* 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, 1843, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_12_transaction_5commit)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1843, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1843, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1843, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1843, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;
  }

  /* "sweepea.pyx":1844
 * 
 *     cpdef commit(self, bint begin=True):
 *         self.db.commit()             # <<<<<<<<<<<<<<
 *         if begin:
 *             self._begin()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->db->__pyx_vtab)->commit(__pyx_v_self->db, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1845
 *     cpdef commit(self, bint begin=True):
 *         self.db.commit()
 *         if begin:             # <<<<<<<<<<<<<<
 *             self._begin()
 * 
 */
  __pyx_t_7 = (__pyx_v_begin != 0);
  if (__pyx_t_7) {

    /* "sweepea.pyx":1846
 *         self.db.commit()
 *         if begin:
 *             self._begin()             # <<<<<<<<<<<<<<
 * 
 *     cpdef rollback(self, bint begin=True):
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea__transaction *)__pyx_v_self->__pyx_vtab)->_begin(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1846, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":1845
 *     cpdef commit(self, bint begin=True):
 *         self.db.commit()
 *         if begin:             # <<<<<<<<<<<<<<
 *             self._begin()
 * 
 */
  }

  /* "sweepea.pyx":1843
 *         self.db.begin(self.lock)
 * 
 *     cpdef commit(self, bint begin=True):             # <<<<<<<<<<<<<<
 *         self.db.commit()
 *         if 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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("sweepea._transaction.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_7sweepea_12_transaction_5commit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_12_transaction_5commit(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_begin;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("commit (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_begin,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) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_begin);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "commit") < 0)) __PYX_ERR(0, 1843, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_begin = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_begin == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1843, __pyx_L3_error)
    } else {
      __pyx_v_begin = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("commit", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1843, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea._transaction.commit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_12_transaction_4commit(((struct __pyx_obj_7sweepea__transaction *)__pyx_v_self), __pyx_v_begin);

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

static PyObject *__pyx_pf_7sweepea_12_transaction_4commit(struct __pyx_obj_7sweepea__transaction *__pyx_v_self, int __pyx_v_begin) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7sweepea_12_transaction_commit __pyx_t_2;
  __Pyx_RefNannySetupContext("commit", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.begin = __pyx_v_begin;
  __pyx_t_1 = __pyx_vtabptr_7sweepea__transaction->commit(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1843, __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("sweepea._transaction.commit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1848
 *             self._begin()
 * 
 *     cpdef rollback(self, bint begin=True):             # <<<<<<<<<<<<<<
 *         self.db.rollback()
 *         if begin:
 */

static PyObject *__pyx_pw_7sweepea_12_transaction_7rollback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_7sweepea_12_transaction_rollback(struct __pyx_obj_7sweepea__transaction *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_12_transaction_rollback *__pyx_optional_args) {
  int __pyx_v_begin = ((int)1);
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("rollback", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_begin = __pyx_optional_args->begin;
    }
  }
  /* 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, 1848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_12_transaction_7rollback)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1848, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1848, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1848, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1848, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;
  }

  /* "sweepea.pyx":1849
 * 
 *     cpdef rollback(self, bint begin=True):
 *         self.db.rollback()             # <<<<<<<<<<<<<<
 *         if begin:
 *             self._begin()
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->db->__pyx_vtab)->rollback(__pyx_v_self->db, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1850
 *     cpdef rollback(self, bint begin=True):
 *         self.db.rollback()
 *         if begin:             # <<<<<<<<<<<<<<
 *             self._begin()
 * 
 */
  __pyx_t_7 = (__pyx_v_begin != 0);
  if (__pyx_t_7) {

    /* "sweepea.pyx":1851
 *         self.db.rollback()
 *         if begin:
 *             self._begin()             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
    __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea__transaction *)__pyx_v_self->__pyx_vtab)->_begin(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1851, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":1850
 *     cpdef rollback(self, bint begin=True):
 *         self.db.rollback()
 *         if begin:             # <<<<<<<<<<<<<<
 *             self._begin()
 * 
 */
  }

  /* "sweepea.pyx":1848
 *             self._begin()
 * 
 *     cpdef rollback(self, bint begin=True):             # <<<<<<<<<<<<<<
 *         self.db.rollback()
 *         if 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_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("sweepea._transaction.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_7sweepea_12_transaction_7rollback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_12_transaction_7rollback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_begin;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rollback (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_begin,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) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_begin);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rollback") < 0)) __PYX_ERR(0, 1848, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_begin = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_begin == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1848, __pyx_L3_error)
    } else {
      __pyx_v_begin = ((int)1);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("rollback", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1848, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea._transaction.rollback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_12_transaction_6rollback(((struct __pyx_obj_7sweepea__transaction *)__pyx_v_self), __pyx_v_begin);

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

static PyObject *__pyx_pf_7sweepea_12_transaction_6rollback(struct __pyx_obj_7sweepea__transaction *__pyx_v_self, int __pyx_v_begin) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_7sweepea_12_transaction_rollback __pyx_t_2;
  __Pyx_RefNannySetupContext("rollback", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 1;
  __pyx_t_2.begin = __pyx_v_begin;
  __pyx_t_1 = __pyx_vtabptr_7sweepea__transaction->rollback(__pyx_v_self, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1848, __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("sweepea._transaction.rollback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1853
 *             self._begin()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         if self.db._transaction_depth() == 0:
 *             self._begin()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_12_transaction_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7sweepea_12_transaction_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_12_transaction_8__enter__(((struct __pyx_obj_7sweepea__transaction *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_12_transaction_8__enter__(struct __pyx_obj_7sweepea__transaction *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "sweepea.pyx":1854
 * 
 *     def __enter__(self):
 *         if self.db._transaction_depth() == 0:             # <<<<<<<<<<<<<<
 *             self._begin()
 *         self.db._push_transaction(self)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->db->__pyx_vtab)->_transaction_depth(__pyx_v_self->db); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_1, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1854, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "sweepea.pyx":1855
 *     def __enter__(self):
 *         if self.db._transaction_depth() == 0:
 *             self._begin()             # <<<<<<<<<<<<<<
 *         self.db._push_transaction(self)
 *         return self
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea__transaction *)__pyx_v_self->__pyx_vtab)->_begin(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1854
 * 
 *     def __enter__(self):
 *         if self.db._transaction_depth() == 0:             # <<<<<<<<<<<<<<
 *             self._begin()
 *         self.db._push_transaction(self)
 */
  }

  /* "sweepea.pyx":1856
 *         if self.db._transaction_depth() == 0:
 *             self._begin()
 *         self.db._push_transaction(self)             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->db->__pyx_vtab)->_push_transaction(__pyx_v_self->db, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":1857
 *             self._begin()
 *         self.db._push_transaction(self)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "sweepea.pyx":1853
 *             self._begin()
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         if self.db._transaction_depth() == 0:
 *             self._begin()
 */

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

/* "sweepea.pyx":1859
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         try:
 *             if exc_type:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_12_transaction_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_12_transaction_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_val = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_tb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_tb,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 1859, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 1859, __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, 1859, __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_type = values[0];
    __pyx_v_exc_val = values[1];
    __pyx_v_exc_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1859, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea._transaction.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_12_transaction_10__exit__(((struct __pyx_obj_7sweepea__transaction *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_val, __pyx_v_exc_tb);

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

static PyObject *__pyx_pf_7sweepea_12_transaction_10__exit__(struct __pyx_obj_7sweepea__transaction *__pyx_v_self, PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  struct __pyx_opt_args_7sweepea_12_transaction_rollback __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  struct __pyx_opt_args_7sweepea_12_transaction_commit __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  char const *__pyx_t_13;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "sweepea.pyx":1860
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 *         try:             # <<<<<<<<<<<<<<
 *             if exc_type:
 *                 self.rollback(False)
 */
  /*try:*/ {

    /* "sweepea.pyx":1861
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 *         try:
 *             if exc_type:             # <<<<<<<<<<<<<<
 *                 self.rollback(False)
 *             elif self.db._transaction_depth() == 1:
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc_type); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1861, __pyx_L4_error)
    if (__pyx_t_1) {

      /* "sweepea.pyx":1862
 *         try:
 *             if exc_type:
 *                 self.rollback(False)             # <<<<<<<<<<<<<<
 *             elif self.db._transaction_depth() == 1:
 *                 try:
 */
      __pyx_t_3.__pyx_n = 1;
      __pyx_t_3.begin = 0;
      __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea__transaction *)__pyx_v_self->__pyx_vtab)->rollback(__pyx_v_self, 0, &__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1862, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "sweepea.pyx":1861
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 *         try:
 *             if exc_type:             # <<<<<<<<<<<<<<
 *                 self.rollback(False)
 *             elif self.db._transaction_depth() == 1:
 */
      goto __pyx_L6;
    }

    /* "sweepea.pyx":1863
 *             if exc_type:
 *                 self.rollback(False)
 *             elif self.db._transaction_depth() == 1:             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.commit(False)
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->db->__pyx_vtab)->_transaction_depth(__pyx_v_self->db); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1863, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1863, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1863, __pyx_L4_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

      /* "sweepea.pyx":1864
 *                 self.rollback(False)
 *             elif self.db._transaction_depth() == 1:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.commit(False)
 *                 except:
 */
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_5);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        /*try:*/ {

          /* "sweepea.pyx":1865
 *             elif self.db._transaction_depth() == 1:
 *                 try:
 *                     self.commit(False)             # <<<<<<<<<<<<<<
 *                 except:
 *                     self.rollback(False)
 */
          __pyx_t_8.__pyx_n = 1;
          __pyx_t_8.begin = 0;
          __pyx_t_4 = ((struct __pyx_vtabstruct_7sweepea__transaction *)__pyx_v_self->__pyx_vtab)->commit(__pyx_v_self, 0, &__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1865, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

          /* "sweepea.pyx":1864
 *                 self.rollback(False)
 *             elif self.db._transaction_depth() == 1:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.commit(False)
 *                 except:
 */
        }
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "sweepea.pyx":1866
 *                 try:
 *                     self.commit(False)
 *                 except:             # <<<<<<<<<<<<<<
 *                     self.rollback(False)
 *                     raise
 */
        /*except:*/ {
          __Pyx_AddTraceback("sweepea._transaction.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_9) < 0) __PYX_ERR(0, 1866, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_9);

          /* "sweepea.pyx":1867
 *                     self.commit(False)
 *                 except:
 *                     self.rollback(False)             # <<<<<<<<<<<<<<
 *                     raise
 *         finally:
 */
          __pyx_t_3.__pyx_n = 1;
          __pyx_t_3.begin = 0;
          __pyx_t_10 = ((struct __pyx_vtabstruct_7sweepea__transaction *)__pyx_v_self->__pyx_vtab)->rollback(__pyx_v_self, 0, &__pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1867, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

          /* "sweepea.pyx":1868
 *                 except:
 *                     self.rollback(False)
 *                     raise             # <<<<<<<<<<<<<<
 *         finally:
 *             self.db._pop_transaction()
 */
          __Pyx_GIVEREF(__pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_2);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_2, __pyx_t_9);
          __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_9 = 0; 
          __PYX_ERR(0, 1868, __pyx_L9_except_error)
        }
        __pyx_L9_except_error:;

        /* "sweepea.pyx":1864
 *                 self.rollback(False)
 *             elif self.db._transaction_depth() == 1:
 *                 try:             # <<<<<<<<<<<<<<
 *                     self.commit(False)
 *                 except:
 */
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_5);
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
        goto __pyx_L4_error;
        __pyx_L14_try_end:;
      }

      /* "sweepea.pyx":1863
 *             if exc_type:
 *                 self.rollback(False)
 *             elif self.db._transaction_depth() == 1:             # <<<<<<<<<<<<<<
 *                 try:
 *                     self.commit(False)
 */
    }
    __pyx_L6:;
  }

  /* "sweepea.pyx":1870
 *                     raise
 *         finally:
 *             self.db._pop_transaction()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*finally:*/ {
    /*normal exit:*/{
      __pyx_t_9 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->db->__pyx_vtab)->_pop_transaction(__pyx_v_self->db); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1870, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      goto __pyx_L5;
    }
    /*exception exit:*/{
      __Pyx_PyThreadState_declare
      __pyx_L4_error:;
      __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_6, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __Pyx_XGOTREF(__pyx_t_16);
      __pyx_t_11 = __pyx_lineno; __pyx_t_12 = __pyx_clineno; __pyx_t_13 = __pyx_filename;
      {
        __pyx_t_9 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->db->__pyx_vtab)->_pop_transaction(__pyx_v_self->db); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1870, __pyx_L18_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __Pyx_PyThreadState_assign
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      }
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ErrRestore(__pyx_t_7, __pyx_t_6, __pyx_t_5);
      __pyx_t_7 = 0; __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
      __pyx_lineno = __pyx_t_11; __pyx_clineno = __pyx_t_12; __pyx_filename = __pyx_t_13;
      goto __pyx_L1_error;
      __pyx_L18_error:;
      __Pyx_PyThreadState_assign
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_XGIVEREF(__pyx_t_16);
        __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
      }
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
      goto __pyx_L1_error;
    }
    __pyx_L5:;
  }

  /* "sweepea.pyx":1859
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         try:
 *             if exc_type:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("sweepea._transaction.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1878
 *         Database db
 * 
 *     def __init__(self, Database db, sid=None):             # <<<<<<<<<<<<<<
 *         self.db = db
 *         self.sid = sid or 's' + uuid.uuid4().hex
 */

/* Python wrapper */
static int __pyx_pw_7sweepea_10_savepoint_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7sweepea_10_savepoint_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7sweepea_Database *__pyx_v_db = 0;
  PyObject *__pyx_v_sid = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_db,&__pyx_n_s_sid,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_db)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_sid);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1878, __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_db = ((struct __pyx_obj_7sweepea_Database *)values[0]);
    __pyx_v_sid = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1878, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea._savepoint.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_db), __pyx_ptype_7sweepea_Database, 1, "db", 0))) __PYX_ERR(0, 1878, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_10_savepoint___init__(((struct __pyx_obj_7sweepea__savepoint *)__pyx_v_self), __pyx_v_db, __pyx_v_sid);

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

static int __pyx_pf_7sweepea_10_savepoint___init__(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_db, PyObject *__pyx_v_sid) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":1879
 * 
 *     def __init__(self, Database db, sid=None):
 *         self.db = db             # <<<<<<<<<<<<<<
 *         self.sid = sid or 's' + uuid.uuid4().hex
 *         self.quoted_sid = "%s" % self.sid
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_db));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_db));
  __Pyx_GOTREF(__pyx_v_self->db);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->db));
  __pyx_v_self->db = __pyx_v_db;

  /* "sweepea.pyx":1880
 *     def __init__(self, Database db, sid=None):
 *         self.db = db
 *         self.sid = sid or 's' + uuid.uuid4().hex             # <<<<<<<<<<<<<<
 *         self.quoted_sid = "%s" % self.sid
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_sid); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1880, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_v_sid))||((__pyx_v_sid) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_v_sid)->tp_name), 0))) __PYX_ERR(0, 1880, __pyx_L1_error)
    __Pyx_INCREF(__pyx_v_sid);
    __pyx_t_1 = __pyx_v_sid;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_uuid); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uuid4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1880, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1880, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_hex); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_n_s_s_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (!(likely(__Pyx_PyBaseString_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", (PY_MAJOR_VERSION < 3 ? "basestring" : "str"), Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(0, 1880, __pyx_L1_error)
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->sid);
  __Pyx_DECREF(__pyx_v_self->sid);
  __pyx_v_self->sid = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1881
 *         self.db = db
 *         self.sid = sid or 's' + uuid.uuid4().hex
 *         self.quoted_sid = "%s" % self.sid             # <<<<<<<<<<<<<<
 * 
 *     cpdef _execute(self, basestring query):
 */
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_3, __pyx_v_self->sid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->quoted_sid);
  __Pyx_DECREF(__pyx_v_self->quoted_sid);
  __pyx_v_self->quoted_sid = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1878
 *         Database db
 * 
 *     def __init__(self, Database db, sid=None):             # <<<<<<<<<<<<<<
 *         self.db = db
 *         self.sid = sid or 's' + uuid.uuid4().hex
 */

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

/* "sweepea.pyx":1883
 *         self.quoted_sid = "%s" % self.sid
 * 
 *     cpdef _execute(self, basestring query):             # <<<<<<<<<<<<<<
 *         self.db.execute_sql(query)
 * 
 */

static PyObject *__pyx_pw_7sweepea_10_savepoint_3_execute(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static PyObject *__pyx_f_7sweepea_10_savepoint__execute(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self, PyObject *__pyx_v_query, 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;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("_execute", 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_execute_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1883, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_10_savepoint_3_execute)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1883, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1883, __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_query);
        __Pyx_GIVEREF(__pyx_v_query);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_query);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1883, __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;
  }

  /* "sweepea.pyx":1884
 * 
 *     cpdef _execute(self, basestring query):
 *         self.db.execute_sql(query)             # <<<<<<<<<<<<<<
 * 
 *     cpdef commit(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_self->db->__pyx_vtab)->execute_sql(__pyx_v_self->db, __pyx_v_query, 0, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1883
 *         self.quoted_sid = "%s" % self.sid
 * 
 *     cpdef _execute(self, basestring query):             # <<<<<<<<<<<<<<
 *         self.db.execute_sql(query)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea._savepoint._execute", __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_7sweepea_10_savepoint_3_execute(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static PyObject *__pyx_pw_7sweepea_10_savepoint_3_execute(PyObject *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_execute (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_query), (&PyBaseString_Type), 1, "query", 1))) __PYX_ERR(0, 1883, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_10_savepoint_2_execute(((struct __pyx_obj_7sweepea__savepoint *)__pyx_v_self), ((PyObject*)__pyx_v_query));

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

static PyObject *__pyx_pf_7sweepea_10_savepoint_2_execute(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("_execute", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_10_savepoint__execute(__pyx_v_self, __pyx_v_query, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1883, __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("sweepea._savepoint._execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1886
 *         self.db.execute_sql(query)
 * 
 *     cpdef commit(self):             # <<<<<<<<<<<<<<
 *         self._execute('RELEASE SAVEPOINT %s;' % self.quoted_sid)
 * 
 */

static PyObject *__pyx_pw_7sweepea_10_savepoint_5commit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7sweepea_10_savepoint_commit(struct __pyx_obj_7sweepea__savepoint *__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("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, 1886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_10_savepoint_5commit)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1886, __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, 1886, __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;
  }

  /* "sweepea.pyx":1887
 * 
 *     cpdef commit(self):
 *         self._execute('RELEASE SAVEPOINT %s;' % self.quoted_sid)             # <<<<<<<<<<<<<<
 * 
 *     cpdef rollback(self):
 */
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_RELEASE_SAVEPOINT_s, __pyx_v_self->quoted_sid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea__savepoint *)__pyx_v_self->__pyx_vtab)->_execute(__pyx_v_self, ((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":1886
 *         self.db.execute_sql(query)
 * 
 *     cpdef commit(self):             # <<<<<<<<<<<<<<
 *         self._execute('RELEASE SAVEPOINT %s;' % self.quoted_sid)
 * 
 */

  /* 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("sweepea._savepoint.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_7sweepea_10_savepoint_5commit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7sweepea_10_savepoint_5commit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("commit (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_10_savepoint_4commit(((struct __pyx_obj_7sweepea__savepoint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_10_savepoint_4commit(struct __pyx_obj_7sweepea__savepoint *__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_7sweepea_10_savepoint_commit(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1886, __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("sweepea._savepoint.commit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1889
 *         self._execute('RELEASE SAVEPOINT %s;' % self.quoted_sid)
 * 
 *     cpdef rollback(self):             # <<<<<<<<<<<<<<
 *         self._execute('ROLLBACK TO SAVEPOINT %s;' % self.quoted_sid)
 * 
 */

static PyObject *__pyx_pw_7sweepea_10_savepoint_7rollback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7sweepea_10_savepoint_rollback(struct __pyx_obj_7sweepea__savepoint *__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("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, 1889, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_10_savepoint_7rollback)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1889, __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, 1889, __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;
  }

  /* "sweepea.pyx":1890
 * 
 *     cpdef rollback(self):
 *         self._execute('ROLLBACK TO SAVEPOINT %s;' % self.quoted_sid)             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_ROLLBACK_TO_SAVEPOINT_s, __pyx_v_self->quoted_sid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea__savepoint *)__pyx_v_self->__pyx_vtab)->_execute(__pyx_v_self, ((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1890, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":1889
 *         self._execute('RELEASE SAVEPOINT %s;' % self.quoted_sid)
 * 
 *     cpdef rollback(self):             # <<<<<<<<<<<<<<
 *         self._execute('ROLLBACK TO SAVEPOINT %s;' % self.quoted_sid)
 * 
 */

  /* 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("sweepea._savepoint.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_7sweepea_10_savepoint_7rollback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7sweepea_10_savepoint_7rollback(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rollback (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_10_savepoint_6rollback(((struct __pyx_obj_7sweepea__savepoint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_10_savepoint_6rollback(struct __pyx_obj_7sweepea__savepoint *__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_7sweepea_10_savepoint_rollback(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1889, __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("sweepea._savepoint.rollback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1892
 *         self._execute('ROLLBACK TO SAVEPOINT %s;' % self.quoted_sid)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         self._execute('SAVEPOINT %s;' % self.quoted_sid)
 *         return self
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10_savepoint_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7sweepea_10_savepoint_9__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_10_savepoint_8__enter__(((struct __pyx_obj_7sweepea__savepoint *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_10_savepoint_8__enter__(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "sweepea.pyx":1893
 * 
 *     def __enter__(self):
 *         self._execute('SAVEPOINT %s;' % self.quoted_sid)             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_SAVEPOINT_s, __pyx_v_self->quoted_sid); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea__savepoint *)__pyx_v_self->__pyx_vtab)->_execute(__pyx_v_self, ((PyObject*)__pyx_t_1), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":1894
 *     def __enter__(self):
 *         self._execute('SAVEPOINT %s;' % self.quoted_sid)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "sweepea.pyx":1892
 *         self._execute('ROLLBACK TO SAVEPOINT %s;' % self.quoted_sid)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         self._execute('SAVEPOINT %s;' % self.quoted_sid)
 *         return self
 */

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

/* "sweepea.pyx":1896
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         if exc_type:
 *             self.rollback()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10_savepoint_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_10_savepoint_11__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_val = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_tb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_tb,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 1896, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 1896, __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, 1896, __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_type = values[0];
    __pyx_v_exc_val = values[1];
    __pyx_v_exc_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1896, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea._savepoint.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10_savepoint_10__exit__(((struct __pyx_obj_7sweepea__savepoint *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_val, __pyx_v_exc_tb);

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

static PyObject *__pyx_pf_7sweepea_10_savepoint_10__exit__(struct __pyx_obj_7sweepea__savepoint *__pyx_v_self, PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "sweepea.pyx":1897
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 *         if exc_type:             # <<<<<<<<<<<<<<
 *             self.rollback()
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_exc_type); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1897, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "sweepea.pyx":1898
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 *         if exc_type:
 *             self.rollback()             # <<<<<<<<<<<<<<
 *         else:
 *             try:
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea__savepoint *)__pyx_v_self->__pyx_vtab)->rollback(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1897
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 *         if exc_type:             # <<<<<<<<<<<<<<
 *             self.rollback()
 *         else:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":1900
 *             self.rollback()
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self.commit()
 *             except:
 */
  /*else*/ {
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      /*try:*/ {

        /* "sweepea.pyx":1901
 *         else:
 *             try:
 *                 self.commit()             # <<<<<<<<<<<<<<
 *             except:
 *                 self.rollback()
 */
        __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea__savepoint *)__pyx_v_self->__pyx_vtab)->commit(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1901, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "sweepea.pyx":1900
 *             self.rollback()
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self.commit()
 *             except:
 */
      }
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L11_try_end;
      __pyx_L4_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "sweepea.pyx":1902
 *             try:
 *                 self.commit()
 *             except:             # <<<<<<<<<<<<<<
 *                 self.rollback()
 *                 raise
 */
      /*except:*/ {
        __Pyx_AddTraceback("sweepea._savepoint.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(0, 1902, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_7);

        /* "sweepea.pyx":1903
 *                 self.commit()
 *             except:
 *                 self.rollback()             # <<<<<<<<<<<<<<
 *                 raise
 * 
 */
        __pyx_t_8 = ((struct __pyx_vtabstruct_7sweepea__savepoint *)__pyx_v_self->__pyx_vtab)->rollback(__pyx_v_self, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1903, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

        /* "sweepea.pyx":1904
 *             except:
 *                 self.rollback()
 *                 raise             # <<<<<<<<<<<<<<
 * 
 * 
 */
        __Pyx_GIVEREF(__pyx_t_2);
        __Pyx_GIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_6, __pyx_t_7);
        __pyx_t_2 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0; 
        __PYX_ERR(0, 1904, __pyx_L6_except_error)
      }
      __pyx_L6_except_error:;

      /* "sweepea.pyx":1900
 *             self.rollback()
 *         else:
 *             try:             # <<<<<<<<<<<<<<
 *                 self.commit()
 *             except:
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_3);
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
      goto __pyx_L1_error;
      __pyx_L11_try_end:;
    }
  }
  __pyx_L3:;

  /* "sweepea.pyx":1896
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         if exc_type:
 *             self.rollback()
 */

  /* 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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("sweepea._savepoint.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1922
 *         int scope
 * 
 *     def __cinit__(self, scope=SCOPE_NORMAL, parentheses=False,             # <<<<<<<<<<<<<<
 *                   subquery=False):
 *         self.scope = scope
 */

/* Python wrapper */
static int __pyx_pw_7sweepea_5State_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7sweepea_5State_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_scope = 0;
  PyObject *__pyx_v_parentheses = 0;
  PyObject *__pyx_v_subquery = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scope,&__pyx_n_s_parentheses,&__pyx_n_s_subquery,0};
    PyObject* values[3] = {0,0,0};
    values[0] = __pyx_k__48;
    values[1] = ((PyObject *)Py_False);

    /* "sweepea.pyx":1923
 * 
 *     def __cinit__(self, scope=SCOPE_NORMAL, parentheses=False,
 *                   subquery=False):             # <<<<<<<<<<<<<<
 *         self.scope = scope
 *         self.parentheses = parentheses
 */
    values[2] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scope);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parentheses);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_subquery);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 1922, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_scope = values[0];
    __pyx_v_parentheses = values[1];
    __pyx_v_subquery = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1922, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.State.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5State___cinit__(((struct __pyx_obj_7sweepea_State *)__pyx_v_self), __pyx_v_scope, __pyx_v_parentheses, __pyx_v_subquery);

  /* "sweepea.pyx":1922
 *         int scope
 * 
 *     def __cinit__(self, scope=SCOPE_NORMAL, parentheses=False,             # <<<<<<<<<<<<<<
 *                   subquery=False):
 *         self.scope = scope
 */

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

static int __pyx_pf_7sweepea_5State___cinit__(struct __pyx_obj_7sweepea_State *__pyx_v_self, PyObject *__pyx_v_scope, PyObject *__pyx_v_parentheses, PyObject *__pyx_v_subquery) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "sweepea.pyx":1924
 *     def __cinit__(self, scope=SCOPE_NORMAL, parentheses=False,
 *                   subquery=False):
 *         self.scope = scope             # <<<<<<<<<<<<<<
 *         self.parentheses = parentheses
 *         self.subquery = subquery
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_scope); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1924, __pyx_L1_error)
  __pyx_v_self->scope = __pyx_t_1;

  /* "sweepea.pyx":1925
 *                   subquery=False):
 *         self.scope = scope
 *         self.parentheses = parentheses             # <<<<<<<<<<<<<<
 *         self.subquery = subquery
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_parentheses); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1925, __pyx_L1_error)
  __pyx_v_self->parentheses = __pyx_t_2;

  /* "sweepea.pyx":1926
 *         self.scope = scope
 *         self.parentheses = parentheses
 *         self.subquery = subquery             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self, scope=None, parentheses=None, subquery=None):
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_subquery); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1926, __pyx_L1_error)
  __pyx_v_self->subquery = __pyx_t_2;

  /* "sweepea.pyx":1922
 *         int scope
 * 
 *     def __cinit__(self, scope=SCOPE_NORMAL, parentheses=False,             # <<<<<<<<<<<<<<
 *                   subquery=False):
 *         self.scope = scope
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("sweepea.State.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1928
 *         self.subquery = subquery
 * 
 *     def __call__(self, scope=None, parentheses=None, subquery=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int i_scope = self.scope if scope is None else scope
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5State_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_5State_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_scope = 0;
  PyObject *__pyx_v_parentheses = 0;
  PyObject *__pyx_v_subquery = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_scope,&__pyx_n_s_parentheses,&__pyx_n_s_subquery,0};
    PyObject* values[3] = {0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_scope);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parentheses);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_subquery);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 1928, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_scope = values[0];
    __pyx_v_parentheses = values[1];
    __pyx_v_subquery = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1928, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.State.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5State_2__call__(((struct __pyx_obj_7sweepea_State *)__pyx_v_self), __pyx_v_scope, __pyx_v_parentheses, __pyx_v_subquery);

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

static PyObject *__pyx_pf_7sweepea_5State_2__call__(struct __pyx_obj_7sweepea_State *__pyx_v_self, PyObject *__pyx_v_scope, PyObject *__pyx_v_parentheses, PyObject *__pyx_v_subquery) {
  int __pyx_v_i_scope;
  int __pyx_v_i_subquery;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "sweepea.pyx":1930
 *     def __call__(self, scope=None, parentheses=None, subquery=None):
 *         cdef:
 *             int i_scope = self.scope if scope is None else scope             # <<<<<<<<<<<<<<
 *             bint i_subquery = self.subquery if subquery is None else subquery
 *         return State.__new__(State, i_scope, parentheses, i_subquery)
 */
  __pyx_t_2 = (__pyx_v_scope == Py_None);
  if ((__pyx_t_2 != 0)) {
    __pyx_t_1 = __pyx_v_self->scope;
  } else {
    __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_scope); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1930, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
  }
  __pyx_v_i_scope = __pyx_t_1;

  /* "sweepea.pyx":1931
 *         cdef:
 *             int i_scope = self.scope if scope is None else scope
 *             bint i_subquery = self.subquery if subquery is None else subquery             # <<<<<<<<<<<<<<
 *         return State.__new__(State, i_scope, parentheses, i_subquery)
 * 
 */
  __pyx_t_4 = (__pyx_v_subquery == Py_None);
  if ((__pyx_t_4 != 0)) {
    __pyx_t_2 = __pyx_v_self->subquery;
  } else {
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_subquery); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1931, __pyx_L1_error)
    __pyx_t_2 = __pyx_t_5;
  }
  __pyx_v_i_subquery = __pyx_t_2;

  /* "sweepea.pyx":1932
 *             int i_scope = self.scope if scope is None else scope
 *             bint i_subquery = self.subquery if subquery is None else subquery
 *         return State.__new__(State, i_scope, parentheses, i_subquery)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i_scope); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_i_subquery); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_parentheses);
  __Pyx_GIVEREF(__pyx_v_parentheses);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_v_parentheses);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_7 = __pyx_tp_new_7sweepea_State(((PyTypeObject *)__pyx_ptype_7sweepea_State), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":1928
 *         self.subquery = subquery
 * 
 *     def __call__(self, scope=None, parentheses=None, subquery=None):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int i_scope = self.scope if scope is None else scope
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("sweepea.State.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1935
 * 
 * 
 * def __scope_context__(int scope):             # <<<<<<<<<<<<<<
 *     @contextmanager
 *     def inner(self, **kwargs):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_13__scope_context__(PyObject *__pyx_self, PyObject *__pyx_arg_scope); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_13__scope_context__ = {"__scope_context__", (PyCFunction)__pyx_pw_7sweepea_13__scope_context__, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_13__scope_context__(PyObject *__pyx_self, PyObject *__pyx_arg_scope) {
  int __pyx_v_scope;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__scope_context__ (wrapper)", 0);
  assert(__pyx_arg_scope); {
    __pyx_v_scope = __Pyx_PyInt_As_int(__pyx_arg_scope); if (unlikely((__pyx_v_scope == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1935, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.__scope_context__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_12__scope_context__(__pyx_self, ((int)__pyx_v_scope));

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

/* "sweepea.pyx":1937
 * def __scope_context__(int scope):
 *     @contextmanager
 *     def inner(self, **kwargs):             # <<<<<<<<<<<<<<
 *         with self(scope=scope, **kwargs):
 *             yield self
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_17__scope_context___1inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_17__scope_context___1inner = {"inner", (PyCFunction)__pyx_pw_7sweepea_17__scope_context___1inner, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_17__scope_context___1inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inner (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,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) {
        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;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "inner") < 0)) __PYX_ERR(0, 1937, __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("inner", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1937, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_CLEAR(__pyx_v_kwargs);
  __Pyx_AddTraceback("sweepea.__scope_context__.inner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_17__scope_context___inner(__pyx_self, __pyx_v_self, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7sweepea_17__scope_context___inner(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inner", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner *)__pyx_tp_new_7sweepea___pyx_scope_struct_11_inner(__pyx_ptype_7sweepea___pyx_scope_struct_11_inner, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_10___scope_context__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_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_kwargs = __pyx_v_kwargs;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_kwargs);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_kwargs);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_7sweepea_17__scope_context___2generator1, (PyObject *) __pyx_cur_scope, __pyx_n_s_inner, __pyx_n_s_scope_context___locals_inner, __pyx_n_s_sweepea); if (unlikely(!gen)) __PYX_ERR(0, 1937, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("sweepea.__scope_context__.inner", __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_7sweepea_17__scope_context___2generator1(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner *__pyx_cur_scope = ((struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L16_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, 1937, __pyx_L1_error)

  /* "sweepea.pyx":1938
 *     @contextmanager
 *     def inner(self, **kwargs):
 *         with self(scope=scope, **kwargs):             # <<<<<<<<<<<<<<
 *             yield self
 *     return inner
 */
  /*with:*/ {
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_scope); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_scope, __pyx_t_3) < 0) __PYX_ERR(0, 1938, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    if (__Pyx_MergeKeywords(__pyx_t_1, __pyx_cur_scope->__pyx_v_kwargs) < 0) __PYX_ERR(0, 1938, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_self, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1938, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1938, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1938, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1938, __pyx_L4_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "sweepea.pyx":1939
 *     def inner(self, **kwargs):
 *         with self(scope=scope, **kwargs):
 *             yield self             # <<<<<<<<<<<<<<
 *     return inner
 * 
 */
          __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self);
          __pyx_r = __pyx_cur_scope->__pyx_v_self;
          __Pyx_XGIVEREF(__pyx_t_4);
          __pyx_cur_scope->__pyx_t_0 = __pyx_t_4;
          __Pyx_XGIVEREF(__pyx_t_6);
          __pyx_cur_scope->__pyx_t_1 = __pyx_t_6;
          __Pyx_XGIVEREF(__pyx_t_7);
          __pyx_cur_scope->__pyx_t_2 = __pyx_t_7;
          __Pyx_XGIVEREF(__pyx_t_8);
          __pyx_cur_scope->__pyx_t_3 = __pyx_t_8;
          __Pyx_XGIVEREF(__pyx_r);
          __Pyx_RefNannyFinishContext();
          /* return from generator, yielding value */
          __pyx_generator->resume_label = 1;
          return __pyx_r;
          __pyx_L16_resume_from_yield:;
          __pyx_t_4 = __pyx_cur_scope->__pyx_t_0;
          __pyx_cur_scope->__pyx_t_0 = 0;
          __Pyx_XGOTREF(__pyx_t_4);
          __pyx_t_6 = __pyx_cur_scope->__pyx_t_1;
          __pyx_cur_scope->__pyx_t_1 = 0;
          __Pyx_XGOTREF(__pyx_t_6);
          __pyx_t_7 = __pyx_cur_scope->__pyx_t_2;
          __pyx_cur_scope->__pyx_t_2 = 0;
          __Pyx_XGOTREF(__pyx_t_7);
          __pyx_t_8 = __pyx_cur_scope->__pyx_t_3;
          __pyx_cur_scope->__pyx_t_3 = 0;
          __Pyx_XGOTREF(__pyx_t_8);
          if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 1939, __pyx_L8_error)

          /* "sweepea.pyx":1938
 *     @contextmanager
 *     def inner(self, **kwargs):
 *         with self(scope=scope, **kwargs):             # <<<<<<<<<<<<<<
 *             yield self
 *     return inner
 */
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L15_try_end;
        __pyx_L8_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("sweepea.__scope_context__.inner", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 1938, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_5 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1938, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1938, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (__pyx_t_10 < 0) __PYX_ERR(0, 1938, __pyx_L10_except_error)
          __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0);
          if (__pyx_t_11) {
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_3);
            __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; 
            __PYX_ERR(0, 1938, __pyx_L10_except_error)
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L9_exception_handled;
        }
        __pyx_L10_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L9_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L15_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_4) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__49, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1938, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L7;
      }
      __pyx_L7:;
    }
    goto __pyx_L20;
    __pyx_L4_error:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L1_error;
    __pyx_L20:;
  }

  /* "sweepea.pyx":1937
 * def __scope_context__(int scope):
 *     @contextmanager
 *     def inner(self, **kwargs):             # <<<<<<<<<<<<<<
 *         with self(scope=scope, **kwargs):
 *             yield self
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  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("inner", __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;
}

/* "sweepea.pyx":1935
 * 
 * 
 * def __scope_context__(int scope):             # <<<<<<<<<<<<<<
 *     @contextmanager
 *     def inner(self, **kwargs):
 */

static PyObject *__pyx_pf_7sweepea_12__scope_context__(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_scope) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_10___scope_context__ *__pyx_cur_scope;
  PyObject *__pyx_v_inner = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__scope_context__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_10___scope_context__ *)__pyx_tp_new_7sweepea___pyx_scope_struct_10___scope_context__(__pyx_ptype_7sweepea___pyx_scope_struct_10___scope_context__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_scope = __pyx_v_scope;

  /* "sweepea.pyx":1936
 * 
 * def __scope_context__(int scope):
 *     @contextmanager             # <<<<<<<<<<<<<<
 *     def inner(self, **kwargs):
 *         with self(scope=scope, **kwargs):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_contextmanager); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "sweepea.pyx":1937
 * def __scope_context__(int scope):
 *     @contextmanager
 *     def inner(self, **kwargs):             # <<<<<<<<<<<<<<
 *         with self(scope=scope, **kwargs):
 *             yield self
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_17__scope_context___1inner, 0, __pyx_n_s_scope_context___locals_inner, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__51)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1936, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1936, __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_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1936, __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_inner = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1940
 *         with self(scope=scope, **kwargs):
 *             yield self
 *     return inner             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_inner);
  __pyx_r = __pyx_v_inner;
  goto __pyx_L0;

  /* "sweepea.pyx":1935
 * 
 * 
 * def __scope_context__(int scope):             # <<<<<<<<<<<<<<
 *     @contextmanager
 *     def inner(self, **kwargs):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea.__scope_context__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inner);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1955
 *         public State state
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.stack = []
 *         self._sql = []
 */

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7sweepea_7Context_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_7sweepea_7Context___init__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static int __pyx_pf_7sweepea_7Context___init__(struct __pyx_obj_7sweepea_Context *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":1956
 * 
 *     def __init__(self):
 *         self.stack = []             # <<<<<<<<<<<<<<
 *         self._sql = []
 *         self._values = []
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->stack);
  __Pyx_DECREF(__pyx_v_self->stack);
  __pyx_v_self->stack = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1957
 *     def __init__(self):
 *         self.stack = []
 *         self._sql = []             # <<<<<<<<<<<<<<
 *         self._values = []
 *         self.state = State()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_sql);
  __Pyx_DECREF(__pyx_v_self->_sql);
  __pyx_v_self->_sql = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1958
 *         self.stack = []
 *         self._sql = []
 *         self._values = []             # <<<<<<<<<<<<<<
 *         self.state = State()
 *         self.refresh()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_values);
  __Pyx_DECREF(__pyx_v_self->_values);
  __pyx_v_self->_values = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1959
 *         self._sql = []
 *         self._values = []
 *         self.state = State()             # <<<<<<<<<<<<<<
 *         self.refresh()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea_State), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->state);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->state));
  __pyx_v_self->state = ((struct __pyx_obj_7sweepea_State *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1960
 *         self._values = []
 *         self.state = State()
 *         self.refresh()             # <<<<<<<<<<<<<<
 * 
 *     cdef refresh(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_self->__pyx_vtab)->refresh(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1955
 *         public State state
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         self.stack = []
 *         self._sql = []
 */

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

/* "sweepea.pyx":1962
 *         self.refresh()
 * 
 *     cdef refresh(self):             # <<<<<<<<<<<<<<
 *         self.scope = self.state.scope
 *         self.parentheses = self.state.parentheses
 */

static PyObject *__pyx_f_7sweepea_7Context_refresh(struct __pyx_obj_7sweepea_Context *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("refresh", 0);

  /* "sweepea.pyx":1963
 * 
 *     cdef refresh(self):
 *         self.scope = self.state.scope             # <<<<<<<<<<<<<<
 *         self.parentheses = self.state.parentheses
 *         self.subquery = self.state.subquery
 */
  __pyx_t_1 = __pyx_v_self->state->scope;
  __pyx_v_self->scope = __pyx_t_1;

  /* "sweepea.pyx":1964
 *     cdef refresh(self):
 *         self.scope = self.state.scope
 *         self.parentheses = self.state.parentheses             # <<<<<<<<<<<<<<
 *         self.subquery = self.state.subquery
 * 
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->state->parentheses); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->parentheses);
  __Pyx_DECREF(__pyx_v_self->parentheses);
  __pyx_v_self->parentheses = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "sweepea.pyx":1965
 *         self.scope = self.state.scope
 *         self.parentheses = self.state.parentheses
 *         self.subquery = self.state.subquery             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self, **overrides):
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->state->subquery); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->subquery);
  __Pyx_DECREF(__pyx_v_self->subquery);
  __pyx_v_self->subquery = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "sweepea.pyx":1962
 *         self.refresh()
 * 
 *     cdef refresh(self):             # <<<<<<<<<<<<<<
 *         self.scope = self.state.scope
 *         self.parentheses = self.state.parentheses
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("sweepea.Context.refresh", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1967
 *         self.subquery = self.state.subquery
 * 
 *     def __call__(self, **overrides):             # <<<<<<<<<<<<<<
 *         if overrides and overrides.get('scope') == self.scope:
 *             del overrides['scope']
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Context_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_3__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_overrides = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__call__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return NULL;}
  if (__pyx_kwds && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__call__", 1))) return NULL;
  __pyx_v_overrides = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New(); if (unlikely(!__pyx_v_overrides)) return NULL;
  __Pyx_GOTREF(__pyx_v_overrides);
  __pyx_r = __pyx_pf_7sweepea_7Context_2__call__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self), __pyx_v_overrides);

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

static PyObject *__pyx_pf_7sweepea_7Context_2__call__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_overrides) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "sweepea.pyx":1968
 * 
 *     def __call__(self, **overrides):
 *         if overrides and overrides.get('scope') == self.scope:             # <<<<<<<<<<<<<<
 *             del overrides['scope']
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_overrides); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1968, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_overrides, __pyx_n_s_scope, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_self->scope); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1968, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "sweepea.pyx":1969
 *     def __call__(self, **overrides):
 *         if overrides and overrides.get('scope') == self.scope:
 *             del overrides['scope']             # <<<<<<<<<<<<<<
 * 
 *         self.stack.append(self.state)
 */
    if (unlikely(PyDict_DelItem(__pyx_v_overrides, __pyx_n_s_scope) < 0)) __PYX_ERR(0, 1969, __pyx_L1_error)

    /* "sweepea.pyx":1968
 * 
 *     def __call__(self, **overrides):
 *         if overrides and overrides.get('scope') == self.scope:             # <<<<<<<<<<<<<<
 *             del overrides['scope']
 * 
 */
  }

  /* "sweepea.pyx":1971
 *             del overrides['scope']
 * 
 *         self.stack.append(self.state)             # <<<<<<<<<<<<<<
 *         self.state = self.state(**overrides)
 *         self.refresh()
 */
  if (unlikely(__pyx_v_self->stack == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
    __PYX_ERR(0, 1971, __pyx_L1_error)
  }
  __pyx_t_5 = ((PyObject *)__pyx_v_self->state);
  __Pyx_INCREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->stack, __pyx_t_5); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 1971, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":1972
 * 
 *         self.stack.append(self.state)
 *         self.state = self.state(**overrides)             # <<<<<<<<<<<<<<
 *         self.refresh()
 *         return self
 */
  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_self->state), __pyx_empty_tuple, __pyx_v_overrides); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_7sweepea_State))))) __PYX_ERR(0, 1972, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->state);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->state));
  __pyx_v_self->state = ((struct __pyx_obj_7sweepea_State *)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "sweepea.pyx":1973
 *         self.stack.append(self.state)
 *         self.state = self.state(**overrides)
 *         self.refresh()             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_self->__pyx_vtab)->refresh(__pyx_v_self); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":1974
 *         self.state = self.state(**overrides)
 *         self.refresh()
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     scope_normal = __scope_context__(SCOPE_NORMAL)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "sweepea.pyx":1967
 *         self.subquery = self.state.subquery
 * 
 *     def __call__(self, **overrides):             # <<<<<<<<<<<<<<
 *         if overrides and overrides.get('scope') == self.scope:
 *             del overrides['scope']
 */

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

/* "sweepea.pyx":1981
 *     scope_cte = __scope_context__(SCOPE_CTE)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         if self.parentheses:
 *             self.literal('(')
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Context_5__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_5__enter__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__enter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_4__enter__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_7Context_4__enter__(struct __pyx_obj_7sweepea_Context *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__enter__", 0);

  /* "sweepea.pyx":1982
 * 
 *     def __enter__(self):
 *         if self.parentheses:             # <<<<<<<<<<<<<<
 *             self.literal('(')
 *         return self
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->parentheses); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1982, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "sweepea.pyx":1983
 *     def __enter__(self):
 *         if self.parentheses:
 *             self.literal('(')             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_self->__pyx_vtab)->literal(__pyx_v_self, __pyx_kp_s__52, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1983, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1982
 * 
 *     def __enter__(self):
 *         if self.parentheses:             # <<<<<<<<<<<<<<
 *             self.literal('(')
 *         return self
 */
  }

  /* "sweepea.pyx":1984
 *         if self.parentheses:
 *             self.literal('(')
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "sweepea.pyx":1981
 *     scope_cte = __scope_context__(SCOPE_CTE)
 * 
 *     def __enter__(self):             # <<<<<<<<<<<<<<
 *         if self.parentheses:
 *             self.literal('(')
 */

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

/* "sweepea.pyx":1986
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         if self.parentheses:
 *             self.literal(')')
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Context_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_7__exit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_exc_type = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_val = 0;
  CYTHON_UNUSED PyObject *__pyx_v_exc_tb = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__exit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_exc_type,&__pyx_n_s_exc_val,&__pyx_n_s_exc_tb,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_val)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 1); __PYX_ERR(0, 1986, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exc_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, 2); __PYX_ERR(0, 1986, __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, 1986, __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_type = values[0];
    __pyx_v_exc_val = values[1];
    __pyx_v_exc_tb = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__exit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1986, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Context.__exit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_7Context_6__exit__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self), __pyx_v_exc_type, __pyx_v_exc_val, __pyx_v_exc_tb);

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

static PyObject *__pyx_pf_7sweepea_7Context_6__exit__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_exc_type, CYTHON_UNUSED PyObject *__pyx_v_exc_val, CYTHON_UNUSED PyObject *__pyx_v_exc_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__exit__", 0);

  /* "sweepea.pyx":1987
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 *         if self.parentheses:             # <<<<<<<<<<<<<<
 *             self.literal(')')
 *         self.state = self.stack.pop()
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->parentheses); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 1987, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "sweepea.pyx":1988
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 *         if self.parentheses:
 *             self.literal(')')             # <<<<<<<<<<<<<<
 *         self.state = self.stack.pop()
 *         self.refresh()
 */
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_self->__pyx_vtab)->literal(__pyx_v_self, __pyx_kp_s__53, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1988, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":1987
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):
 *         if self.parentheses:             # <<<<<<<<<<<<<<
 *             self.literal(')')
 *         self.state = self.stack.pop()
 */
  }

  /* "sweepea.pyx":1989
 *         if self.parentheses:
 *             self.literal(')')
 *         self.state = self.stack.pop()             # <<<<<<<<<<<<<<
 *         self.refresh()
 * 
 */
  if (unlikely(__pyx_v_self->stack == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "pop");
    __PYX_ERR(0, 1989, __pyx_L1_error)
  }
  __pyx_t_2 = __Pyx_PyList_Pop(__pyx_v_self->stack); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7sweepea_State))))) __PYX_ERR(0, 1989, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->state);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->state));
  __pyx_v_self->state = ((struct __pyx_obj_7sweepea_State *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "sweepea.pyx":1990
 *             self.literal(')')
 *         self.state = self.stack.pop()
 *         self.refresh()             # <<<<<<<<<<<<<<
 * 
 *     cpdef Context sql(self, obj):
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_self->__pyx_vtab)->refresh(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":1986
 *         return self
 * 
 *     def __exit__(self, exc_type, exc_val, exc_tb):             # <<<<<<<<<<<<<<
 *         if self.parentheses:
 *             self.literal(')')
 */

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

/* "sweepea.pyx":1992
 *         self.refresh()
 * 
 *     cpdef Context sql(self, obj):             # <<<<<<<<<<<<<<
 *         if isinstance(obj, (Node, Context)):
 *             obj.__sql__(self)
 */

static PyObject *__pyx_pw_7sweepea_7Context_9sql(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static struct __pyx_obj_7sweepea_Context *__pyx_f_7sweepea_7Context_sql(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_skip_dispatch) {
  struct __pyx_obj_7sweepea_Context *__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;
  __Pyx_RefNannySetupContext("sql", 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_sql); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_7Context_9sql)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_obj); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1992, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1992, __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_obj);
        __Pyx_GIVEREF(__pyx_v_obj);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_obj);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1992, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7sweepea_Context))))) __PYX_ERR(0, 1992, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_7sweepea_Context *)__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;
  }

  /* "sweepea.pyx":1993
 * 
 *     cpdef Context sql(self, obj):
 *         if isinstance(obj, (Node, Context)):             # <<<<<<<<<<<<<<
 *             obj.__sql__(self)
 *             return self
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyObject_IsInstance(__pyx_v_obj, __pyx_t_1); 
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (!__pyx_t_8) {
  } else {
    __pyx_t_6 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_8 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_7sweepea_Context); 
  __pyx_t_7 = (__pyx_t_8 != 0);
  __pyx_t_6 = __pyx_t_7;
  __pyx_L4_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "sweepea.pyx":1994
 *     cpdef Context sql(self, obj):
 *         if isinstance(obj, (Node, Context)):
 *             obj.__sql__(self)             # <<<<<<<<<<<<<<
 *             return self
 *         else:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_obj, __pyx_n_s_sql_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1994, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1994, __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_self));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_self));
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1994, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":1995
 *         if isinstance(obj, (Node, Context)):
 *             obj.__sql__(self)
 *             return self             # <<<<<<<<<<<<<<
 *         else:
 *             return self.sql(Value(obj))
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __pyx_r = __pyx_v_self;
    goto __pyx_L0;

    /* "sweepea.pyx":1993
 * 
 *     cpdef Context sql(self, obj):
 *         if isinstance(obj, (Node, Context)):             # <<<<<<<<<<<<<<
 *             obj.__sql__(self)
 *             return self
 */
  }

  /* "sweepea.pyx":1997
 *             return self
 *         else:
 *             return self.sql(Value(obj))             # <<<<<<<<<<<<<<
 * 
 *     cpdef Context literal(self, sql):
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_obj);
      __Pyx_GIVEREF(__pyx_v_obj);
      PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_obj);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1997, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_self->__pyx_vtab)->sql(__pyx_v_self, __pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1997, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_7sweepea_Context *)__pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "sweepea.pyx":1992
 *         self.refresh()
 * 
 *     cpdef Context sql(self, obj):             # <<<<<<<<<<<<<<
 *         if isinstance(obj, (Node, Context)):
 *             obj.__sql__(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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea.Context.sql", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Context_9sql(PyObject *__pyx_v_self, PyObject *__pyx_v_obj); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_9sql(PyObject *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sql (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_8sql(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self), ((PyObject *)__pyx_v_obj));

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

static PyObject *__pyx_pf_7sweepea_7Context_8sql(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_obj) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sql", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7sweepea_7Context_sql(__pyx_v_self, __pyx_v_obj, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1992, __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("sweepea.Context.sql", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1999
 *             return self.sql(Value(obj))
 * 
 *     cpdef Context literal(self, sql):             # <<<<<<<<<<<<<<
 *         self._sql.append(sql)
 *         return self
 */

static PyObject *__pyx_pw_7sweepea_7Context_11literal(PyObject *__pyx_v_self, PyObject *__pyx_v_sql); /*proto*/
static struct __pyx_obj_7sweepea_Context *__pyx_f_7sweepea_7Context_literal(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_sql, int __pyx_skip_dispatch) {
  struct __pyx_obj_7sweepea_Context *__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;
  __Pyx_RefNannySetupContext("literal", 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_literal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_7Context_11literal)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_sql); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1999, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1999, __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_sql);
        __Pyx_GIVEREF(__pyx_v_sql);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_sql);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1999, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_7sweepea_Context))))) __PYX_ERR(0, 1999, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_7sweepea_Context *)__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;
  }

  /* "sweepea.pyx":2000
 * 
 *     cpdef Context literal(self, sql):
 *         self._sql.append(sql)             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  if (unlikely(__pyx_v_self->_sql == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
    __PYX_ERR(0, 2000, __pyx_L1_error)
  }
  __pyx_t_6 = __Pyx_PyList_Append(__pyx_v_self->_sql, __pyx_v_sql); if (unlikely(__pyx_t_6 == -1)) __PYX_ERR(0, 2000, __pyx_L1_error)

  /* "sweepea.pyx":2001
 *     cpdef Context literal(self, sql):
 *         self._sql.append(sql)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     cdef Context bind_value(self, value):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "sweepea.pyx":1999
 *             return self.sql(Value(obj))
 * 
 *     cpdef Context literal(self, sql):             # <<<<<<<<<<<<<<
 *         self._sql.append(sql)
 *         return 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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea.Context.literal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Context_11literal(PyObject *__pyx_v_self, PyObject *__pyx_v_sql); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_11literal(PyObject *__pyx_v_self, PyObject *__pyx_v_sql) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("literal (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_10literal(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self), ((PyObject *)__pyx_v_sql));

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

static PyObject *__pyx_pf_7sweepea_7Context_10literal(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_sql) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("literal", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_7sweepea_7Context_literal(__pyx_v_self, __pyx_v_sql, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1999, __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("sweepea.Context.literal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2003
 *         return self
 * 
 *     cdef Context bind_value(self, value):             # <<<<<<<<<<<<<<
 *         self._values.append(value)
 *         return self
 */

static struct __pyx_obj_7sweepea_Context *__pyx_f_7sweepea_7Context_bind_value(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value) {
  struct __pyx_obj_7sweepea_Context *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("bind_value", 0);

  /* "sweepea.pyx":2004
 * 
 *     cdef Context bind_value(self, value):
 *         self._values.append(value)             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  if (unlikely(__pyx_v_self->_values == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
    __PYX_ERR(0, 2004, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_values, __pyx_v_value); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2004, __pyx_L1_error)

  /* "sweepea.pyx":2005
 *     cdef Context bind_value(self, value):
 *         self._values.append(value)
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     cdef Context __sql__(self, Context ctx):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "sweepea.pyx":2003
 *         return self
 * 
 *     cdef Context bind_value(self, value):             # <<<<<<<<<<<<<<
 *         self._values.append(value)
 *         return self
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("sweepea.Context.bind_value", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2007
 *         return self
 * 
 *     cdef Context __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx._sql.extend(self._sql)
 *         ctx._values.extend(self._values)
 */

static struct __pyx_obj_7sweepea_Context *__pyx_f_7sweepea_7Context___sql__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  struct __pyx_obj_7sweepea_Context *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2008
 * 
 *     cdef Context __sql__(self, Context ctx):
 *         ctx._sql.extend(self._sql)             # <<<<<<<<<<<<<<
 *         ctx._values.extend(self._values)
 *         return ctx
 */
  if (unlikely(__pyx_v_ctx->_sql == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "extend");
    __PYX_ERR(0, 2008, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->_sql;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyList_Extend(__pyx_v_ctx->_sql, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2008, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2009
 *     cdef Context __sql__(self, Context ctx):
 *         ctx._sql.extend(self._sql)
 *         ctx._values.extend(self._values)             # <<<<<<<<<<<<<<
 *         return ctx
 * 
 */
  if (unlikely(__pyx_v_ctx->_values == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "extend");
    __PYX_ERR(0, 2009, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_self->_values;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyList_Extend(__pyx_v_ctx->_values, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2009, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2010
 *         ctx._sql.extend(self._sql)
 *         ctx._values.extend(self._values)
 *         return ctx             # <<<<<<<<<<<<<<
 * 
 *     cpdef tuple parse(self, query):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
  __pyx_r = __pyx_v_ctx;
  goto __pyx_L0;

  /* "sweepea.pyx":2007
 *         return self
 * 
 *     cdef Context __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx._sql.extend(self._sql)
 *         ctx._values.extend(self._values)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.Context.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2012
 *         return ctx
 * 
 *     cpdef tuple parse(self, query):             # <<<<<<<<<<<<<<
 *         self.sql(query)
 *         return ''.join(self._sql), self._values
 */

static PyObject *__pyx_pw_7sweepea_7Context_13parse(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static PyObject *__pyx_f_7sweepea_7Context_parse(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_query, 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;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("parse", 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_parse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_7Context_13parse)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2012, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2012, __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_query);
        __Pyx_GIVEREF(__pyx_v_query);
        PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_query);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2012, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 2012, __pyx_L1_error)
      __pyx_r = ((PyObject*)__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;
  }

  /* "sweepea.pyx":2013
 * 
 *     cpdef tuple parse(self, query):
 *         self.sql(query)             # <<<<<<<<<<<<<<
 *         return ''.join(self._sql), self._values
 * 
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_self->__pyx_vtab)->sql(__pyx_v_self, __pyx_v_query, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2014
 *     cpdef tuple parse(self, query):
 *         self.sql(query)
 *         return ''.join(self._sql), self._values             # <<<<<<<<<<<<<<
 * 
 *     cpdef tuple query(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->_sql;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__23, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->_values);
  __Pyx_GIVEREF(__pyx_v_self->_values);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_values);
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2012
 *         return ctx
 * 
 *     cpdef tuple parse(self, query):             # <<<<<<<<<<<<<<
 *         self.sql(query)
 *         return ''.join(self._sql), self._values
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea.Context.parse", __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_7sweepea_7Context_13parse(PyObject *__pyx_v_self, PyObject *__pyx_v_query); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_13parse(PyObject *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("parse (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_12parse(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self), ((PyObject *)__pyx_v_query));

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

static PyObject *__pyx_pf_7sweepea_7Context_12parse(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_query) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("parse", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_7Context_parse(__pyx_v_self, __pyx_v_query, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2012, __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("sweepea.Context.parse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2016
 *         return ''.join(self._sql), self._values
 * 
 *     cpdef tuple query(self):             # <<<<<<<<<<<<<<
 *         return ''.join(self._sql), self._values
 * 
 */

static PyObject *__pyx_pw_7sweepea_7Context_15query(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_7sweepea_7Context_query(struct __pyx_obj_7sweepea_Context *__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("query", 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_query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_7sweepea_7Context_15query)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2016, __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, 2016, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(0, 2016, __pyx_L1_error)
      __pyx_r = ((PyObject*)__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;
  }

  /* "sweepea.pyx":2017
 * 
 *     cpdef tuple query(self):
 *         return ''.join(self._sql), self._values             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_v_self->_sql;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__23, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2017, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->_values);
  __Pyx_GIVEREF(__pyx_v_self->_values);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_values);
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2016
 *         return ''.join(self._sql), self._values
 * 
 *     cpdef tuple query(self):             # <<<<<<<<<<<<<<
 *         return ''.join(self._sql), self._values
 * 
 */

  /* 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("sweepea.Context.query", __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_7sweepea_7Context_15query(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_15query(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("query (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_14query(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_7Context_14query(struct __pyx_obj_7sweepea_Context *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("query", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_7Context_query(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2016, __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("sweepea.Context.query", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1950
 *     """
 *     cdef:
 *         public parentheses, subquery             # <<<<<<<<<<<<<<
 *         public int scope
 *         public list stack, _sql, _values
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Context_11parentheses_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_11parentheses_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_11parentheses___get__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_7Context_11parentheses___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->parentheses);
  __pyx_r = __pyx_v_self->parentheses;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_11parentheses_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7sweepea_7Context_11parentheses_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_11parentheses_2__set__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7sweepea_7Context_11parentheses_2__set__(struct __pyx_obj_7sweepea_Context *__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->parentheses);
  __Pyx_DECREF(__pyx_v_self->parentheses);
  __pyx_v_self->parentheses = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_11parentheses_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7sweepea_7Context_11parentheses_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_11parentheses_4__del__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static int __pyx_pf_7sweepea_7Context_11parentheses_4__del__(struct __pyx_obj_7sweepea_Context *__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->parentheses);
  __Pyx_DECREF(__pyx_v_self->parentheses);
  __pyx_v_self->parentheses = Py_None;

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

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Context_8subquery_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_8subquery_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_8subquery___get__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_7Context_8subquery___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->subquery);
  __pyx_r = __pyx_v_self->subquery;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_8subquery_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7sweepea_7Context_8subquery_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_8subquery_2__set__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7sweepea_7Context_8subquery_2__set__(struct __pyx_obj_7sweepea_Context *__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->subquery);
  __Pyx_DECREF(__pyx_v_self->subquery);
  __pyx_v_self->subquery = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_8subquery_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7sweepea_7Context_8subquery_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_8subquery_4__del__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static int __pyx_pf_7sweepea_7Context_8subquery_4__del__(struct __pyx_obj_7sweepea_Context *__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->subquery);
  __Pyx_DECREF(__pyx_v_self->subquery);
  __pyx_v_self->subquery = Py_None;

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

/* "sweepea.pyx":1951
 *     cdef:
 *         public parentheses, subquery
 *         public int scope             # <<<<<<<<<<<<<<
 *         public list stack, _sql, _values
 *         public State state
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Context_5scope_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_5scope_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_5scope___get__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_7Context_5scope___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->scope); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1951, __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("sweepea.Context.scope.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_5scope_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7sweepea_7Context_5scope_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_5scope_2__set__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7sweepea_7Context_5scope_2__set__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1951, __pyx_L1_error)
  __pyx_v_self->scope = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("sweepea.Context.scope.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":1952
 *         public parentheses, subquery
 *         public int scope
 *         public list stack, _sql, _values             # <<<<<<<<<<<<<<
 *         public State state
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Context_5stack_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_5stack_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_5stack___get__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_7Context_5stack___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->stack);
  __pyx_r = __pyx_v_self->stack;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_5stack_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7sweepea_7Context_5stack_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_5stack_2__set__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7sweepea_7Context_5stack_2__set__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1952, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->stack);
  __Pyx_DECREF(__pyx_v_self->stack);
  __pyx_v_self->stack = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_5stack_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7sweepea_7Context_5stack_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_5stack_4__del__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static int __pyx_pf_7sweepea_7Context_5stack_4__del__(struct __pyx_obj_7sweepea_Context *__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->stack);
  __Pyx_DECREF(__pyx_v_self->stack);
  __pyx_v_self->stack = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Context_4_sql_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_4_sql_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_4_sql___get__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_7Context_4_sql___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_sql);
  __pyx_r = __pyx_v_self->_sql;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_4_sql_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7sweepea_7Context_4_sql_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_4_sql_2__set__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7sweepea_7Context_4_sql_2__set__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1952, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_sql);
  __Pyx_DECREF(__pyx_v_self->_sql);
  __pyx_v_self->_sql = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_4_sql_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7sweepea_7Context_4_sql_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_4_sql_4__del__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static int __pyx_pf_7sweepea_7Context_4_sql_4__del__(struct __pyx_obj_7sweepea_Context *__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->_sql);
  __Pyx_DECREF(__pyx_v_self->_sql);
  __pyx_v_self->_sql = ((PyObject*)Py_None);

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

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Context_7_values_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_7_values_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_7_values___get__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_7Context_7_values___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_values);
  __pyx_r = __pyx_v_self->_values;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_7_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7sweepea_7Context_7_values_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_7_values_2__set__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7sweepea_7Context_7_values_2__set__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(0, 1952, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_values);
  __Pyx_DECREF(__pyx_v_self->_values);
  __pyx_v_self->_values = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_7_values_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7sweepea_7Context_7_values_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_7_values_4__del__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static int __pyx_pf_7sweepea_7Context_7_values_4__del__(struct __pyx_obj_7sweepea_Context *__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->_values);
  __Pyx_DECREF(__pyx_v_self->_values);
  __pyx_v_self->_values = ((PyObject*)Py_None);

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

/* "sweepea.pyx":1953
 *         public int scope
 *         public list stack, _sql, _values
 *         public State state             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Context_5state_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_7sweepea_7Context_5state_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_5state___get__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_7Context_5state___get__(struct __pyx_obj_7sweepea_Context *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->state));
  __pyx_r = ((PyObject *)__pyx_v_self->state);
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_5state_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_7sweepea_7Context_5state_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_5state_2__set__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_7sweepea_7Context_5state_2__set__(struct __pyx_obj_7sweepea_Context *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_7sweepea_State))))) __PYX_ERR(0, 1953, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->state);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->state));
  __pyx_v_self->state = ((struct __pyx_obj_7sweepea_State *)__pyx_t_1);
  __pyx_t_1 = 0;

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

/* Python wrapper */
static int __pyx_pw_7sweepea_7Context_5state_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_7sweepea_7Context_5state_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Context_5state_4__del__(((struct __pyx_obj_7sweepea_Context *)__pyx_v_self));

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

static int __pyx_pf_7sweepea_7Context_5state_4__del__(struct __pyx_obj_7sweepea_Context *__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->state);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->state));
  __pyx_v_self->state = ((struct __pyx_obj_7sweepea_State *)Py_None);

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

/* "sweepea.pyx":2033
 *     """
 *     cdef object source
 *     def __init__(self, source):             # <<<<<<<<<<<<<<
 *         self.source = source
 *     def __getattr__(self, attr):
 */

/* Python wrapper */
static int __pyx_pw_7sweepea_13ColumnFactory_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_7sweepea_13ColumnFactory_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,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) {
        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_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2033, __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_source = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2033, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.ColumnFactory.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_13ColumnFactory___init__(((struct __pyx_obj_7sweepea_ColumnFactory *)__pyx_v_self), __pyx_v_source);

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

static int __pyx_pf_7sweepea_13ColumnFactory___init__(struct __pyx_obj_7sweepea_ColumnFactory *__pyx_v_self, PyObject *__pyx_v_source) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":2034
 *     cdef object source
 *     def __init__(self, source):
 *         self.source = source             # <<<<<<<<<<<<<<
 *     def __getattr__(self, attr):
 *         return Column(self.source, attr)
 */
  __Pyx_INCREF(__pyx_v_source);
  __Pyx_GIVEREF(__pyx_v_source);
  __Pyx_GOTREF(__pyx_v_self->source);
  __Pyx_DECREF(__pyx_v_self->source);
  __pyx_v_self->source = __pyx_v_source;

  /* "sweepea.pyx":2033
 *     """
 *     cdef object source
 *     def __init__(self, source):             # <<<<<<<<<<<<<<
 *         self.source = source
 *     def __getattr__(self, attr):
 */

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

/* "sweepea.pyx":2035
 *     def __init__(self, source):
 *         self.source = source
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return Column(self.source, attr)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_13ColumnFactory_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
static PyObject *__pyx_pw_7sweepea_13ColumnFactory_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_13ColumnFactory_2__getattr__(((struct __pyx_obj_7sweepea_ColumnFactory *)__pyx_v_self), ((PyObject *)__pyx_v_attr));

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

static PyObject *__pyx_pf_7sweepea_13ColumnFactory_2__getattr__(struct __pyx_obj_7sweepea_ColumnFactory *__pyx_v_self, PyObject *__pyx_v_attr) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "sweepea.pyx":2036
 *         self.source = source
 *     def __getattr__(self, attr):
 *         return Column(self.source, attr)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Column); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self->source);
  __Pyx_GIVEREF(__pyx_v_self->source);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self->source);
  __Pyx_INCREF(__pyx_v_attr);
  __Pyx_GIVEREF(__pyx_v_attr);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_attr);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2036, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2035
 *     def __init__(self, source):
 *         self.source = source
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         return Column(self.source, attr)
 * 
 */

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

/* "sweepea.pyx":2043
 *     Descriptor that exposes the ColumnFactory as a "magic" attribute.
 *     """
 *     def __get__(self, instance, instance_type):             # <<<<<<<<<<<<<<
 *         if instance is not None:
 *             return ColumnFactory(instance)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_14_DynamicColumn_1__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_instance, PyObject *__pyx_v_instance_type); /*proto*/
static PyObject *__pyx_pw_7sweepea_14_DynamicColumn_1__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_instance, PyObject *__pyx_v_instance_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_14_DynamicColumn___get__(((struct __pyx_obj_7sweepea__DynamicColumn *)__pyx_v_self), ((PyObject *)__pyx_v_instance), ((PyObject *)__pyx_v_instance_type));

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

static PyObject *__pyx_pf_7sweepea_14_DynamicColumn___get__(struct __pyx_obj_7sweepea__DynamicColumn *__pyx_v_self, PyObject *__pyx_v_instance, CYTHON_UNUSED PyObject *__pyx_v_instance_type) {
  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("__get__", 0);

  /* "sweepea.pyx":2044
 *     """
 *     def __get__(self, instance, instance_type):
 *         if instance is not None:             # <<<<<<<<<<<<<<
 *             return ColumnFactory(instance)
 *         return self
 */
  __pyx_t_1 = (__pyx_v_instance != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":2045
 *     def __get__(self, instance, instance_type):
 *         if instance is not None:
 *             return ColumnFactory(instance)             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_instance);
    __Pyx_GIVEREF(__pyx_v_instance);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_instance);
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea_ColumnFactory), __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;

    /* "sweepea.pyx":2044
 *     """
 *     def __get__(self, instance, instance_type):
 *         if instance is not None:             # <<<<<<<<<<<<<<
 *             return ColumnFactory(instance)
 *         return self
 */
  }

  /* "sweepea.pyx":2046
 *         if instance is not None:
 *             return ColumnFactory(instance)
 *         return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "sweepea.pyx":2043
 *     Descriptor that exposes the ColumnFactory as a "magic" attribute.
 *     """
 *     def __get__(self, instance, instance_type):             # <<<<<<<<<<<<<<
 *         if instance is not None:
 *             return ColumnFactory(instance)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("sweepea._DynamicColumn.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2054
 *     their own column attributes.
 *     """
 *     def __get__(self, instance, instance_type):             # <<<<<<<<<<<<<<
 *         if instance is not None:
 *             raise AttributeError('%s specifies columns explicitly and does not'
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_15_ExplicitColumn_1__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_instance, PyObject *__pyx_v_instance_type); /*proto*/
static PyObject *__pyx_pw_7sweepea_15_ExplicitColumn_1__get__(PyObject *__pyx_v_self, PyObject *__pyx_v_instance, PyObject *__pyx_v_instance_type) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_15_ExplicitColumn___get__(((struct __pyx_obj_7sweepea__ExplicitColumn *)__pyx_v_self), ((PyObject *)__pyx_v_instance), ((PyObject *)__pyx_v_instance_type));

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

static PyObject *__pyx_pf_7sweepea_15_ExplicitColumn___get__(struct __pyx_obj_7sweepea__ExplicitColumn *__pyx_v_self, PyObject *__pyx_v_instance, CYTHON_UNUSED PyObject *__pyx_v_instance_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "sweepea.pyx":2055
 *     """
 *     def __get__(self, instance, instance_type):
 *         if instance is not None:             # <<<<<<<<<<<<<<
 *             raise AttributeError('%s specifies columns explicitly and does not'
 *                                  ' support dynamic column lookups.')
 */
  __pyx_t_1 = (__pyx_v_instance != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":2056
 *     def __get__(self, instance, instance_type):
 *         if instance is not None:
 *             raise AttributeError('%s specifies columns explicitly and does not'             # <<<<<<<<<<<<<<
 *                                  ' support dynamic column lookups.')
 *         return self
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 2056, __pyx_L1_error)

    /* "sweepea.pyx":2055
 *     """
 *     def __get__(self, instance, instance_type):
 *         if instance is not None:             # <<<<<<<<<<<<<<
 *             raise AttributeError('%s specifies columns explicitly and does not'
 *                                  ' support dynamic column lookups.')
 */
  }

  /* "sweepea.pyx":2058
 *             raise AttributeError('%s specifies columns explicitly and does not'
 *                                  ' support dynamic column lookups.')
 *         return self             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "sweepea.pyx":2054
 *     their own column attributes.
 *     """
 *     def __get__(self, instance, instance_type):             # <<<<<<<<<<<<<<
 *         if instance is not None:
 *             raise AttributeError('%s specifies columns explicitly and does not'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("sweepea._ExplicitColumn.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2062
 * 
 * class Node(object):
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         obj = self.__class__.__new__(self.__class__)
 *         obj.__dict__ = self.__dict__.copy()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_4Node_1clone(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_4Node_1clone = {"clone", (PyCFunction)__pyx_pw_7sweepea_4Node_1clone, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_4Node_1clone(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clone (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_4Node_clone(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_4Node_clone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_obj = 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;
  __Pyx_RefNannySetupContext("clone", 0);

  /* "sweepea.pyx":2063
 * class Node(object):
 *     def clone(self):
 *         obj = self.__class__.__new__(self.__class__)             # <<<<<<<<<<<<<<
 *         obj.__dict__ = self.__dict__.copy()
 *         return obj
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2063, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2063, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2063, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_obj = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":2064
 *     def clone(self):
 *         obj = self.__class__.__new__(self.__class__)
 *         obj.__dict__ = self.__dict__.copy()             # <<<<<<<<<<<<<<
 *         return obj
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dict); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2064, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2064, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_obj, __pyx_n_s_dict, __pyx_t_1) < 0) __PYX_ERR(0, 2064, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2065
 *         obj = self.__class__.__new__(self.__class__)
 *         obj.__dict__ = self.__dict__.copy()
 *         return obj             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_obj);
  __pyx_r = __pyx_v_obj;
  goto __pyx_L0;

  /* "sweepea.pyx":2062
 * 
 * class Node(object):
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         obj = self.__class__.__new__(self.__class__)
 *         obj.__dict__ = self.__dict__.copy()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea.Node.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_obj);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2068
 * 
 *     @staticmethod
 *     def copy(method):             # <<<<<<<<<<<<<<
 *         def inner(self, *args, **kwargs):
 *             clone = self.clone()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_4Node_3copy(PyObject *__pyx_self, PyObject *__pyx_v_method); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_4Node_3copy = {"copy", (PyCFunction)__pyx_pw_7sweepea_4Node_3copy, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_4Node_3copy(PyObject *__pyx_self, PyObject *__pyx_v_method) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_4Node_2copy(__pyx_self, ((PyObject *)__pyx_v_method));

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

/* "sweepea.pyx":2069
 *     @staticmethod
 *     def copy(method):
 *         def inner(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *             clone = self.clone()
 *             method(clone, *args, **kwargs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_4Node_4copy_1inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_4Node_4copy_1inner = {"inner", (PyCFunction)__pyx_pw_7sweepea_4Node_4copy_1inner, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_4Node_4copy_1inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inner (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_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, __pyx_v_kwargs, values, used_pos_args, "inner") < 0)) __PYX_ERR(0, 2069, __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("inner", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2069, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("sweepea.Node.copy.inner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_4Node_4copy_inner(__pyx_self, __pyx_v_self, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7sweepea_4Node_4copy_inner(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy *__pyx_cur_scope;
  struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy *__pyx_outer_scope;
  PyObject *__pyx_v_clone = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("inner", 0);
  __pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "sweepea.pyx":2070
 *     def copy(method):
 *         def inner(self, *args, **kwargs):
 *             clone = self.clone()             # <<<<<<<<<<<<<<
 *             method(clone, *args, **kwargs)
 *             return clone
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_clone); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2070, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2070, __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, 2070, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_clone = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":2071
 *         def inner(self, *args, **kwargs):
 *             clone = self.clone()
 *             method(clone, *args, **kwargs)             # <<<<<<<<<<<<<<
 *             return clone
 *         return inner
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_method)) { __Pyx_RaiseClosureNameError("method"); __PYX_ERR(0, 2071, __pyx_L1_error) }
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_clone);
  __Pyx_GIVEREF(__pyx_v_clone);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_clone);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_v_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_method, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2071, __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;

  /* "sweepea.pyx":2072
 *             clone = self.clone()
 *             method(clone, *args, **kwargs)
 *             return clone             # <<<<<<<<<<<<<<
 *         return inner
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_clone);
  __pyx_r = __pyx_v_clone;
  goto __pyx_L0;

  /* "sweepea.pyx":2069
 *     @staticmethod
 *     def copy(method):
 *         def inner(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *             clone = self.clone()
 *             method(clone, *args, **kwargs)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("sweepea.Node.copy.inner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_clone);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2068
 * 
 *     @staticmethod
 *     def copy(method):             # <<<<<<<<<<<<<<
 *         def inner(self, *args, **kwargs):
 *             clone = self.clone()
 */

static PyObject *__pyx_pf_7sweepea_4Node_2copy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_method) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy *__pyx_cur_scope;
  PyObject *__pyx_v_inner = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("copy", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy *)__pyx_tp_new_7sweepea___pyx_scope_struct_12_copy(__pyx_ptype_7sweepea___pyx_scope_struct_12_copy, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_method = __pyx_v_method;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_method);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_method);

  /* "sweepea.pyx":2069
 *     @staticmethod
 *     def copy(method):
 *         def inner(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *             clone = self.clone()
 *             method(clone, *args, **kwargs)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_4Node_4copy_1inner, 0, __pyx_n_s_Node_copy_locals_inner, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__56)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_inner = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":2073
 *             method(clone, *args, **kwargs)
 *             return clone
 *         return inner             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_inner);
  __pyx_r = __pyx_v_inner;
  goto __pyx_L0;

  /* "sweepea.pyx":2068
 * 
 *     @staticmethod
 *     def copy(method):             # <<<<<<<<<<<<<<
 *         def inner(self, *args, **kwargs):
 *             clone = self.clone()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.Node.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inner);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2079
 *     c = _DynamicColumn()
 * 
 *     def __init__(self, alias=None):             # <<<<<<<<<<<<<<
 *         super(Source, self).__init__()
 *         self._alias = alias
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Source_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Source_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_6Source_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Source_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_alias = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_alias,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_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_alias);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2079, __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_alias = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2079, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Source.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Source___init__(__pyx_self, __pyx_v_self, __pyx_v_alias);

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

static PyObject *__pyx_pf_7sweepea_6Source___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_alias) {
  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);

  /* "sweepea.pyx":2080
 * 
 *     def __init__(self, alias=None):
 *         super(Source, self).__init__()             # <<<<<<<<<<<<<<
 *         self._alias = alias
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Source); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2080, __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, 2080, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2081
 *     def __init__(self, alias=None):
 *         super(Source, self).__init__()
 *         self._alias = alias             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_alias_2, __pyx_v_alias) < 0) __PYX_ERR(0, 2081, __pyx_L1_error)

  /* "sweepea.pyx":2079
 *     c = _DynamicColumn()
 * 
 *     def __init__(self, alias=None):             # <<<<<<<<<<<<<<
 *         super(Source, self).__init__()
 *         self._alias = alias
 */

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

/* "sweepea.pyx":2084
 * 
 *     @Node.copy
 *     def alias(self, name=None):             # <<<<<<<<<<<<<<
 *         self._alias = name
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Source_3alias(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Source_3alias = {"alias", (PyCFunction)__pyx_pw_7sweepea_6Source_3alias, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Source_3alias(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("alias (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,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_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_name);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "alias") < 0)) __PYX_ERR(0, 2084, __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_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("alias", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2084, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Source.alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Source_2alias(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_7sweepea_6Source_2alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("alias", 0);

  /* "sweepea.pyx":2085
 *     @Node.copy
 *     def alias(self, name=None):
 *         self._alias = name             # <<<<<<<<<<<<<<
 * 
 *     def select(self, *selection):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_alias_2, __pyx_v_name) < 0) __PYX_ERR(0, 2085, __pyx_L1_error)

  /* "sweepea.pyx":2084
 * 
 *     @Node.copy
 *     def alias(self, name=None):             # <<<<<<<<<<<<<<
 *         self._alias = name
 * 
 */

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

/* "sweepea.pyx":2087
 *         self._alias = name
 * 
 *     def select(self, *selection):             # <<<<<<<<<<<<<<
 *         return Select((self,), selection)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Source_5select(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Source_5select = {"select", (PyCFunction)__pyx_pw_7sweepea_6Source_5select, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Source_5select(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_selection = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("select (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_selection = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_selection)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_selection);
  } else {
    __pyx_v_selection = __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, "select") < 0)) __PYX_ERR(0, 2087, __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("select", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2087, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_selection); __pyx_v_selection = 0;
  __Pyx_AddTraceback("sweepea.Source.select", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Source_4select(__pyx_self, __pyx_v_self, __pyx_v_selection);

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

static PyObject *__pyx_pf_7sweepea_6Source_4select(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_selection) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("select", 0);

  /* "sweepea.pyx":2088
 * 
 *     def select(self, *selection):
 *         return Select((self,), selection)             # <<<<<<<<<<<<<<
 * 
 *     def join(self, other, join_type='INNER', on=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Select); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2088, __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_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_selection);
  __Pyx_GIVEREF(__pyx_v_selection);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_selection);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2087
 *         self._alias = name
 * 
 *     def select(self, *selection):             # <<<<<<<<<<<<<<
 *         return Select((self,), selection)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("sweepea.Source.select", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2090
 *         return Select((self,), selection)
 * 
 *     def join(self, other, join_type='INNER', on=None):             # <<<<<<<<<<<<<<
 *         return Join(self, other, join_type, on)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Source_7join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Source_7join = {"join", (PyCFunction)__pyx_pw_7sweepea_6Source_7join, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Source_7join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_join_type = 0;
  PyObject *__pyx_v_on = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("join (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,&__pyx_n_s_join_type,&__pyx_n_s_on,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_n_s_INNER));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("join", 0, 2, 4, 1); __PYX_ERR(0, 2090, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_join_type);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_on);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) __PYX_ERR(0, 2090, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_other = values[1];
    __pyx_v_join_type = values[2];
    __pyx_v_on = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("join", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2090, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Source.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Source_6join(__pyx_self, __pyx_v_self, __pyx_v_other, __pyx_v_join_type, __pyx_v_on);

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

static PyObject *__pyx_pf_7sweepea_6Source_6join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_join_type, PyObject *__pyx_v_on) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("join", 0);

  /* "sweepea.pyx":2091
 * 
 *     def join(self, other, join_type='INNER', on=None):
 *         return Join(self, other, join_type, on)             # <<<<<<<<<<<<<<
 * 
 *     def left_outer_join(self, other, on=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
  __Pyx_INCREF(__pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_other);
  __Pyx_INCREF(__pyx_v_join_type);
  __Pyx_GIVEREF(__pyx_v_join_type);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_join_type);
  __Pyx_INCREF(__pyx_v_on);
  __Pyx_GIVEREF(__pyx_v_on);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_on);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2091, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2090
 *         return Select((self,), selection)
 * 
 *     def join(self, other, join_type='INNER', on=None):             # <<<<<<<<<<<<<<
 *         return Join(self, other, join_type, on)
 * 
 */

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

/* "sweepea.pyx":2093
 *         return Join(self, other, join_type, on)
 * 
 *     def left_outer_join(self, other, on=None):             # <<<<<<<<<<<<<<
 *         return self.join(other, 'LEFT OUTER', on)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Source_9left_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Source_9left_outer_join = {"left_outer_join", (PyCFunction)__pyx_pw_7sweepea_6Source_9left_outer_join, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Source_9left_outer_join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_on = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("left_outer_join (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_other,&__pyx_n_s_on,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((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  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_other)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("left_outer_join", 0, 2, 3, 1); __PYX_ERR(0, 2093, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_on);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "left_outer_join") < 0)) __PYX_ERR(0, 2093, __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_other = values[1];
    __pyx_v_on = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("left_outer_join", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2093, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Source.left_outer_join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Source_8left_outer_join(__pyx_self, __pyx_v_self, __pyx_v_other, __pyx_v_on);

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

static PyObject *__pyx_pf_7sweepea_6Source_8left_outer_join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_on) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("left_outer_join", 0);

  /* "sweepea.pyx":2094
 * 
 *     def left_outer_join(self, other, on=None):
 *         return self.join(other, 'LEFT OUTER', on)             # <<<<<<<<<<<<<<
 * 
 *     def apply_alias(self, Context ctx):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_other);
  __Pyx_INCREF(__pyx_kp_s_LEFT_OUTER);
  __Pyx_GIVEREF(__pyx_kp_s_LEFT_OUTER);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_kp_s_LEFT_OUTER);
  __Pyx_INCREF(__pyx_v_on);
  __Pyx_GIVEREF(__pyx_v_on);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_on);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2094, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2093
 *         return Join(self, other, join_type, on)
 * 
 *     def left_outer_join(self, other, on=None):             # <<<<<<<<<<<<<<
 *         return self.join(other, 'LEFT OUTER', on)
 * 
 */

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

/* "sweepea.pyx":2096
 *         return self.join(other, 'LEFT OUTER', on)
 * 
 *     def apply_alias(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if ctx.scope == SCOPE_SOURCE and self._alias:
 *             ctx.literal(' AS ').sql(Entity(self._alias))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Source_11apply_alias(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Source_11apply_alias = {"apply_alias", (PyCFunction)__pyx_pw_7sweepea_6Source_11apply_alias, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Source_11apply_alias(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("apply_alias (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply_alias", 1, 2, 2, 1); __PYX_ERR(0, 2096, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply_alias") < 0)) __PYX_ERR(0, 2096, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("apply_alias", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2096, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Source.apply_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2096, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Source_10apply_alias(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_6Source_10apply_alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  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;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("apply_alias", 0);

  /* "sweepea.pyx":2097
 * 
 *     def apply_alias(self, Context ctx):
 *         if ctx.scope == SCOPE_SOURCE and self._alias:             # <<<<<<<<<<<<<<
 *             ctx.literal(' AS ').sql(Entity(self._alias))
 *         return ctx
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ctx->scope); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCOPE_SOURCE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_5) {
  } else {
    __pyx_t_1 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_alias_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2097, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_5;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "sweepea.pyx":2098
 *     def apply_alias(self, Context ctx):
 *         if ctx.scope == SCOPE_SOURCE and self._alias:
 *             ctx.literal(' AS ').sql(Entity(self._alias))             # <<<<<<<<<<<<<<
 *         return ctx
 * 
 */
    __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_AS, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2098, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2098, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_alias_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2098, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2098, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2098, __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_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2098, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_4)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_4), __pyx_t_3, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2098, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":2097
 * 
 *     def apply_alias(self, Context ctx):
 *         if ctx.scope == SCOPE_SOURCE and self._alias:             # <<<<<<<<<<<<<<
 *             ctx.literal(' AS ').sql(Entity(self._alias))
 *         return ctx
 */
  }

  /* "sweepea.pyx":2099
 *         if ctx.scope == SCOPE_SOURCE and self._alias:
 *             ctx.literal(' AS ').sql(Entity(self._alias))
 *         return ctx             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
  __pyx_r = ((PyObject *)__pyx_v_ctx);
  goto __pyx_L0;

  /* "sweepea.pyx":2096
 *         return self.join(other, 'LEFT OUTER', on)
 * 
 *     def apply_alias(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if ctx.scope == SCOPE_SOURCE and self._alias:
 *             ctx.literal(' AS ').sql(Entity(self._alias))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("sweepea.Source.apply_alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2103
 * 
 * class Table(Source):
 *     def __init__(self, name, columns=None, schema=None, alias=None):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self._columns = columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Table_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Table_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_5Table_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Table_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_v_schema = 0;
  PyObject *__pyx_v_alias = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_columns,&__pyx_n_s_schema,&__pyx_n_s_alias,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        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_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 2103, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_columns);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_schema);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alias);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2103, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_name = values[1];
    __pyx_v_columns = values[2];
    __pyx_v_schema = values[3];
    __pyx_v_alias = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2103, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Table.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Table___init__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_columns, __pyx_v_schema, __pyx_v_alias);

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

static PyObject *__pyx_pf_7sweepea_5Table___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_columns, PyObject *__pyx_v_schema, PyObject *__pyx_v_alias) {
  PyObject *__pyx_v_column = 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;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":2104
 * class Table(Source):
 *     def __init__(self, name, columns=None, schema=None, alias=None):
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self._columns = columns
 *         self._schema = schema
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 2104, __pyx_L1_error)

  /* "sweepea.pyx":2105
 *     def __init__(self, name, columns=None, schema=None, alias=None):
 *         self.name = name
 *         self._columns = columns             # <<<<<<<<<<<<<<
 *         self._schema = schema
 *         self._path = (self._schema, name) if self._schema else (name,)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_columns_2, __pyx_v_columns) < 0) __PYX_ERR(0, 2105, __pyx_L1_error)

  /* "sweepea.pyx":2106
 *         self.name = name
 *         self._columns = columns
 *         self._schema = schema             # <<<<<<<<<<<<<<
 *         self._path = (self._schema, name) if self._schema else (name,)
 *         super(Table, self).__init__(alias=alias)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_schema_2, __pyx_v_schema) < 0) __PYX_ERR(0, 2106, __pyx_L1_error)

  /* "sweepea.pyx":2107
 *         self._columns = columns
 *         self._schema = schema
 *         self._path = (self._schema, name) if self._schema else (name,)             # <<<<<<<<<<<<<<
 *         super(Table, self).__init__(alias=alias)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_schema_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2107, __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, 2107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_schema_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_name);
    __pyx_t_2 = 0;
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  } else {
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_name);
    __pyx_t_1 = __pyx_t_4;
    __pyx_t_4 = 0;
  }
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_path, __pyx_t_1) < 0) __PYX_ERR(0, 2107, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2108
 *         self._schema = schema
 *         self._path = (self._schema, name) if self._schema else (name,)
 *         super(Table, self).__init__(alias=alias)             # <<<<<<<<<<<<<<
 * 
 *         if self._columns:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alias, __pyx_v_alias) < 0) __PYX_ERR(0, 2108, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2108, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2110
 *         super(Table, self).__init__(alias=alias)
 * 
 *         if self._columns:             # <<<<<<<<<<<<<<
 *             self.c = _ExplicitColumn()
 *             for column in self._columns:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_columns_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2110, __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, 2110, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "sweepea.pyx":2111
 * 
 *         if self._columns:
 *             self.c = _ExplicitColumn()             # <<<<<<<<<<<<<<
 *             for column in self._columns:
 *                 setattr(self, column, Column(self, column))
 */
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea__ExplicitColumn), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2111, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_c, __pyx_t_2) < 0) __PYX_ERR(0, 2111, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":2112
 *         if self._columns:
 *             self.c = _ExplicitColumn()
 *             for column in self._columns:             # <<<<<<<<<<<<<<
 *                 setattr(self, column, Column(self, column))
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_columns_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2112, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    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_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2112, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2112, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2112, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2112, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 2112, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2112, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_6(__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, 2112, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_column, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "sweepea.pyx":2113
 *             self.c = _ExplicitColumn()
 *             for column in self._columns:
 *                 setattr(self, column, Column(self, column))             # <<<<<<<<<<<<<<
 * 
 *     def clone(self):
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Column); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = NULL;
      __pyx_t_8 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_8 = 1;
        }
      }
      __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_v_self);
      __Pyx_GIVEREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_self);
      __Pyx_INCREF(__pyx_v_column);
      __Pyx_GIVEREF(__pyx_v_column);
      PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_column);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_10 = PyObject_SetAttr(__pyx_v_self, __pyx_v_column, __pyx_t_2); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2113, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "sweepea.pyx":2112
 *         if self._columns:
 *             self.c = _ExplicitColumn()
 *             for column in self._columns:             # <<<<<<<<<<<<<<
 *                 setattr(self, column, Column(self, column))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":2110
 *         super(Table, self).__init__(alias=alias)
 * 
 *         if self._columns:             # <<<<<<<<<<<<<<
 *             self.c = _ExplicitColumn()
 *             for column in self._columns:
 */
  }

  /* "sweepea.pyx":2103
 * 
 * class Table(Source):
 *     def __init__(self, name, columns=None, schema=None, alias=None):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self._columns = columns
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("sweepea.Table.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_column);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2115
 *                 setattr(self, column, Column(self, column))
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         return Table(self.name, self._columns, schema=self._schema,
 *                      alias=self._alias)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Table_3clone(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Table_3clone = {"clone", (PyCFunction)__pyx_pw_7sweepea_5Table_3clone, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_5Table_3clone(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clone (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_5Table_2clone(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_5Table_2clone(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;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("clone", 0);

  /* "sweepea.pyx":2116
 * 
 *     def clone(self):
 *         return Table(self.name, self._columns, schema=self._schema,             # <<<<<<<<<<<<<<
 *                      alias=self._alias)
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_columns_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_schema_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_schema, __pyx_t_2) < 0) __PYX_ERR(0, 2116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2117
 *     def clone(self):
 *         return Table(self.name, self._columns, schema=self._schema,
 *                      alias=self._alias)             # <<<<<<<<<<<<<<
 * 
 *     def select(self, *selection):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_alias_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_alias, __pyx_t_2) < 0) __PYX_ERR(0, 2116, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2116
 * 
 *     def clone(self):
 *         return Table(self.name, self._columns, schema=self._schema,             # <<<<<<<<<<<<<<
 *                      alias=self._alias)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2115
 *                 setattr(self, column, Column(self, column))
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         return Table(self.name, self._columns, schema=self._schema,
 *                      alias=self._alias)
 */

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

/* "sweepea.pyx":2119
 *                      alias=self._alias)
 * 
 *     def select(self, *selection):             # <<<<<<<<<<<<<<
 *         if not selection and self._columns:
 *             selection = [Column(self, column) for column in self._columns]
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Table_5select(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Table_5select = {"select", (PyCFunction)__pyx_pw_7sweepea_5Table_5select, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Table_5select(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_selection = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("select (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_selection = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_selection)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_selection);
  } else {
    __pyx_v_selection = __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, "select") < 0)) __PYX_ERR(0, 2119, __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("select", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2119, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_selection); __pyx_v_selection = 0;
  __Pyx_AddTraceback("sweepea.Table.select", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Table_4select(__pyx_self, __pyx_v_self, __pyx_v_selection);

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

static PyObject *__pyx_pf_7sweepea_5Table_4select(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_selection) {
  PyObject *__pyx_v_column = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  Py_ssize_t __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("select", 0);
  __Pyx_INCREF(__pyx_v_selection);

  /* "sweepea.pyx":2120
 * 
 *     def select(self, *selection):
 *         if not selection and self._columns:             # <<<<<<<<<<<<<<
 *             selection = [Column(self, column) for column in self._columns]
 *         return Select((self,), selection)
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_selection); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2120, __pyx_L1_error)
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_columns_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2120, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "sweepea.pyx":2121
 *     def select(self, *selection):
 *         if not selection and self._columns:
 *             selection = [Column(self, column) for column in self._columns]             # <<<<<<<<<<<<<<
 *         return Select((self,), selection)
 * 
 */
    __pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_columns_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_6 = __pyx_t_5; __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_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2121, __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, 2121, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2121, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2121, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 2121, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2121, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_8(__pyx_t_6);
        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, 2121, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_v_column, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Column); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_10 = NULL;
      __pyx_t_11 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_9, function);
          __pyx_t_11 = 1;
        }
      }
      __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2121, __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_self);
      __Pyx_GIVEREF(__pyx_v_self);
      PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_v_self);
      __Pyx_INCREF(__pyx_v_column);
      __Pyx_GIVEREF(__pyx_v_column);
      PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_v_column);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_12, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 2121, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_selection, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "sweepea.pyx":2120
 * 
 *     def select(self, *selection):
 *         if not selection and self._columns:             # <<<<<<<<<<<<<<
 *             selection = [Column(self, column) for column in self._columns]
 *         return Select((self,), selection)
 */
  }

  /* "sweepea.pyx":2122
 *         if not selection and self._columns:
 *             selection = [Column(self, column) for column in self._columns]
 *         return Select((self,), selection)             # <<<<<<<<<<<<<<
 * 
 *     def insert(self, data, **kwargs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_Select); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self);
  __pyx_t_9 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_12 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2122, __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_5);
  PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_7, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_selection);
  __Pyx_GIVEREF(__pyx_v_selection);
  PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_7, __pyx_v_selection);
  __pyx_t_5 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2119
 *                      alias=self._alias)
 * 
 *     def select(self, *selection):             # <<<<<<<<<<<<<<
 *         if not selection and self._columns:
 *             selection = [Column(self, column) for column in self._columns]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("sweepea.Table.select", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_selection);
  __Pyx_XDECREF(__pyx_v_column);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2124
 *         return Select((self,), selection)
 * 
 *     def insert(self, data, **kwargs):             # <<<<<<<<<<<<<<
 *         return Insert(self, data, **kwargs)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Table_7insert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Table_7insert = {"insert", (PyCFunction)__pyx_pw_7sweepea_5Table_7insert, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Table_7insert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        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_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(0, 2124, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "insert") < 0)) __PYX_ERR(0, 2124, __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_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2124, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("sweepea.Table.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Table_6insert(__pyx_self, __pyx_v_self, __pyx_v_data, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7sweepea_5Table_6insert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);

  /* "sweepea.pyx":2125
 * 
 *     def insert(self, data, **kwargs):
 *         return Insert(self, data, **kwargs)             # <<<<<<<<<<<<<<
 * 
 *     def update(self, data):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self);
  __Pyx_INCREF(__pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_data);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2124
 *         return Select((self,), selection)
 * 
 *     def insert(self, data, **kwargs):             # <<<<<<<<<<<<<<
 *         return Insert(self, data, **kwargs)
 * 
 */

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

/* "sweepea.pyx":2127
 *         return Insert(self, data, **kwargs)
 * 
 *     def update(self, data):             # <<<<<<<<<<<<<<
 *         return Update(self, data)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Table_9update(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Table_9update = {"update", (PyCFunction)__pyx_pw_7sweepea_5Table_9update, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Table_9update(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_data,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        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_data)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("update", 1, 2, 2, 1); __PYX_ERR(0, 2127, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "update") < 0)) __PYX_ERR(0, 2127, __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_data = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("update", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2127, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Table.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Table_8update(__pyx_self, __pyx_v_self, __pyx_v_data);

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

static PyObject *__pyx_pf_7sweepea_5Table_8update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("update", 0);

  /* "sweepea.pyx":2128
 * 
 *     def update(self, data):
 *         return Update(self, data)             # <<<<<<<<<<<<<<
 * 
 *     def delete(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Update); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
  __Pyx_INCREF(__pyx_v_data);
  __Pyx_GIVEREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_data);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2128, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2127
 *         return Insert(self, data, **kwargs)
 * 
 *     def update(self, data):             # <<<<<<<<<<<<<<
 *         return Update(self, data)
 * 
 */

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

/* "sweepea.pyx":2130
 *         return Update(self, data)
 * 
 *     def delete(self):             # <<<<<<<<<<<<<<
 *         return Delete(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Table_11delete(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Table_11delete = {"delete", (PyCFunction)__pyx_pw_7sweepea_5Table_11delete, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_5Table_11delete(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_5Table_10delete(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_5Table_10delete(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;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("delete", 0);

  /* "sweepea.pyx":2131
 * 
 *     def delete(self):
 *         return Delete(self)             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Delete); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2131, __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_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2131, __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;

  /* "sweepea.pyx":2130
 *         return Update(self, data)
 * 
 *     def delete(self):             # <<<<<<<<<<<<<<
 *         return Delete(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("sweepea.Table.delete", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2133
 *         return Delete(self)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if ctx.scope == SCOPE_SOURCE:
 *             ctx.sql(Entity(*self._path))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Table_13__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Table_13__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_5Table_13__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Table_13__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2133, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2133, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2133, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Table.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2133, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_5Table_12__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_5Table_12__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  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;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2134
 * 
 *     def __sql__(self, Context ctx):
 *         if ctx.scope == SCOPE_SOURCE:             # <<<<<<<<<<<<<<
 *             ctx.sql(Entity(*self._path))
 *             if self._alias:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ctx->scope); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCOPE_SOURCE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2134, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2134, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "sweepea.pyx":2135
 *     def __sql__(self, Context ctx):
 *         if ctx.scope == SCOPE_SOURCE:
 *             ctx.sql(Entity(*self._path))             # <<<<<<<<<<<<<<
 *             if self._alias:
 *                 ctx.literal(' AS ')
 */
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_2, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2135, __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;

    /* "sweepea.pyx":2136
 *         if ctx.scope == SCOPE_SOURCE:
 *             ctx.sql(Entity(*self._path))
 *             if self._alias:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' AS ')
 *                 ctx.sql(Entity(self._alias))
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_alias_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2136, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "sweepea.pyx":2137
 *             ctx.sql(Entity(*self._path))
 *             if self._alias:
 *                 ctx.literal(' AS ')             # <<<<<<<<<<<<<<
 *                 ctx.sql(Entity(self._alias))
 *         elif self._alias:
 */
      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_AS, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "sweepea.pyx":2138
 *             if self._alias:
 *                 ctx.literal(' AS ')
 *                 ctx.sql(Entity(self._alias))             # <<<<<<<<<<<<<<
 *         elif self._alias:
 *             ctx.sql(Entity(self._alias))
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_alias_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2138, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2138, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2138, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "sweepea.pyx":2136
 *         if ctx.scope == SCOPE_SOURCE:
 *             ctx.sql(Entity(*self._path))
 *             if self._alias:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' AS ')
 *                 ctx.sql(Entity(self._alias))
 */
    }

    /* "sweepea.pyx":2134
 * 
 *     def __sql__(self, Context ctx):
 *         if ctx.scope == SCOPE_SOURCE:             # <<<<<<<<<<<<<<
 *             ctx.sql(Entity(*self._path))
 *             if self._alias:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":2139
 *                 ctx.literal(' AS ')
 *                 ctx.sql(Entity(self._alias))
 *         elif self._alias:             # <<<<<<<<<<<<<<
 *             ctx.sql(Entity(self._alias))
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_alias_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2139, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2139, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_4) {

    /* "sweepea.pyx":2140
 *                 ctx.sql(Entity(self._alias))
 *         elif self._alias:
 *             ctx.sql(Entity(self._alias))             # <<<<<<<<<<<<<<
 *         else:
 *             ctx.sql(Entity(*self._path))
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_alias_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2140, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2140, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2140, __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_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2140, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_2, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2140, __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;

    /* "sweepea.pyx":2139
 *                 ctx.literal(' AS ')
 *                 ctx.sql(Entity(self._alias))
 *         elif self._alias:             # <<<<<<<<<<<<<<
 *             ctx.sql(Entity(self._alias))
 *         else:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":2142
 *             ctx.sql(Entity(self._alias))
 *         else:
 *             ctx.sql(Entity(*self._path))             # <<<<<<<<<<<<<<
 *         return ctx
 * 
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PySequence_Tuple(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_2, 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_L3:;

  /* "sweepea.pyx":2143
 *         else:
 *             ctx.sql(Entity(*self._path))
 *         return ctx             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
  __pyx_r = ((PyObject *)__pyx_v_ctx);
  goto __pyx_L0;

  /* "sweepea.pyx":2133
 *         return Delete(self)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if ctx.scope == SCOPE_SOURCE:
 *             ctx.sql(Entity(*self._path))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("sweepea.Table.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2147
 * 
 * class Join(Source):
 *     def __init__(self, lhs, rhs, join_type='INNER', on=None):             # <<<<<<<<<<<<<<
 *         super(Join, self).__init__()
 *         self._lhs = lhs
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_4Join_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_4Join_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_4Join_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_4Join_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_lhs = 0;
  PyObject *__pyx_v_rhs = 0;
  PyObject *__pyx_v_join_type = 0;
  PyObject *__pyx_v_on = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_lhs,&__pyx_n_s_rhs,&__pyx_n_s_join_type,&__pyx_n_s_on,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)((PyObject*)__pyx_n_s_INNER));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        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_lhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 2147, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 2147, __pyx_L3_error)
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_join_type);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_on);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2147, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_lhs = values[1];
    __pyx_v_rhs = values[2];
    __pyx_v_join_type = values[3];
    __pyx_v_on = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2147, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Join.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_4Join___init__(__pyx_self, __pyx_v_self, __pyx_v_lhs, __pyx_v_rhs, __pyx_v_join_type, __pyx_v_on);

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

static PyObject *__pyx_pf_7sweepea_4Join___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_rhs, PyObject *__pyx_v_join_type, PyObject *__pyx_v_on) {
  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);

  /* "sweepea.pyx":2148
 * class Join(Source):
 *     def __init__(self, lhs, rhs, join_type='INNER', on=None):
 *         super(Join, self).__init__()             # <<<<<<<<<<<<<<
 *         self._lhs = lhs
 *         self._rhs = rhs
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2148, __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, 2148, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2149
 *     def __init__(self, lhs, rhs, join_type='INNER', on=None):
 *         super(Join, self).__init__()
 *         self._lhs = lhs             # <<<<<<<<<<<<<<
 *         self._rhs = rhs
 *         self._join_type = join_type
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lhs_2, __pyx_v_lhs) < 0) __PYX_ERR(0, 2149, __pyx_L1_error)

  /* "sweepea.pyx":2150
 *         super(Join, self).__init__()
 *         self._lhs = lhs
 *         self._rhs = rhs             # <<<<<<<<<<<<<<
 *         self._join_type = join_type
 *         self._on = on
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rhs_2, __pyx_v_rhs) < 0) __PYX_ERR(0, 2150, __pyx_L1_error)

  /* "sweepea.pyx":2151
 *         self._lhs = lhs
 *         self._rhs = rhs
 *         self._join_type = join_type             # <<<<<<<<<<<<<<
 *         self._on = on
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_join_type_2, __pyx_v_join_type) < 0) __PYX_ERR(0, 2151, __pyx_L1_error)

  /* "sweepea.pyx":2152
 *         self._rhs = rhs
 *         self._join_type = join_type
 *         self._on = on             # <<<<<<<<<<<<<<
 * 
 *     def on(self, predicate):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_on_2, __pyx_v_on) < 0) __PYX_ERR(0, 2152, __pyx_L1_error)

  /* "sweepea.pyx":2147
 * 
 * class Join(Source):
 *     def __init__(self, lhs, rhs, join_type='INNER', on=None):             # <<<<<<<<<<<<<<
 *         super(Join, self).__init__()
 *         self._lhs = lhs
 */

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

/* "sweepea.pyx":2154
 *         self._on = on
 * 
 *     def on(self, predicate):             # <<<<<<<<<<<<<<
 *         self._on = predicate
 *         return self
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_4Join_3on(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_4Join_3on = {"on", (PyCFunction)__pyx_pw_7sweepea_4Join_3on, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_4Join_3on(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_predicate = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_predicate,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_predicate)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("on", 1, 2, 2, 1); __PYX_ERR(0, 2154, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "on") < 0)) __PYX_ERR(0, 2154, __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_predicate = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("on", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2154, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Join.on", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_4Join_2on(__pyx_self, __pyx_v_self, __pyx_v_predicate);

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

static PyObject *__pyx_pf_7sweepea_4Join_2on(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_predicate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on", 0);

  /* "sweepea.pyx":2155
 * 
 *     def on(self, predicate):
 *         self._on = predicate             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_on_2, __pyx_v_predicate) < 0) __PYX_ERR(0, 2155, __pyx_L1_error)

  /* "sweepea.pyx":2156
 *     def on(self, predicate):
 *         self._on = predicate
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "sweepea.pyx":2154
 *         self._on = on
 * 
 *     def on(self, predicate):             # <<<<<<<<<<<<<<
 *         self._on = predicate
 *         return self
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("sweepea.Join.on", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2158
 *         return self
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         (ctx
 *          .sql(self._lhs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_4Join_5__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_4Join_5__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_4Join_5__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_4Join_5__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2158, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2158, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2158, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Join.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2158, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_4Join_4__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_4Join_4__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  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("__sql__", 0);

  /* "sweepea.pyx":2160
 *     def __sql__(self, Context ctx):
 *         (ctx
 *          .sql(self._lhs)             # <<<<<<<<<<<<<<
 *          .literal(' %s JOIN ' % self._join_type)
 *          .sql(self._rhs))
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lhs_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2161
 *         (ctx
 *          .sql(self._lhs)
 *          .literal(' %s JOIN ' % self._join_type)             # <<<<<<<<<<<<<<
 *          .sql(self._rhs))
 *         if self._on is not None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_join_type_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_JOIN, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_2)->__pyx_vtab)->literal(((struct __pyx_obj_7sweepea_Context *)__pyx_t_2), __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "sweepea.pyx":2162
 *          .sql(self._lhs)
 *          .literal(' %s JOIN ' % self._join_type)
 *          .sql(self._rhs))             # <<<<<<<<<<<<<<
 *         if self._on is not None:
 *             ctx.literal(' ON ').sql(self._on)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rhs_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_1)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_1), __pyx_t_3, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2162, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2163
 *          .literal(' %s JOIN ' % self._join_type)
 *          .sql(self._rhs))
 *         if self._on is not None:             # <<<<<<<<<<<<<<
 *             ctx.literal(' ON ').sql(self._on)
 *         return ctx
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = (__pyx_t_2 != Py_None);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "sweepea.pyx":2164
 *          .sql(self._rhs))
 *         if self._on is not None:
 *             ctx.literal(' ON ').sql(self._on)             # <<<<<<<<<<<<<<
 *         return ctx
 * 
 */
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_ON, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_2)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_2), __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":2163
 *          .literal(' %s JOIN ' % self._join_type)
 *          .sql(self._rhs))
 *         if self._on is not None:             # <<<<<<<<<<<<<<
 *             ctx.literal(' ON ').sql(self._on)
 *         return ctx
 */
  }

  /* "sweepea.pyx":2165
 *         if self._on is not None:
 *             ctx.literal(' ON ').sql(self._on)
 *         return ctx             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
  __pyx_r = ((PyObject *)__pyx_v_ctx);
  goto __pyx_L0;

  /* "sweepea.pyx":2158
 *         return self
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         (ctx
 *          .sql(self._lhs)
 */

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

/* "sweepea.pyx":2169
 * 
 * class CTE(Source):
 *     def __init__(self, name, query, recursive=False, columns=None):             # <<<<<<<<<<<<<<
 *         self._alias = name
 *         self._nested_cte_list = query._cte_list
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_3CTE_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_3CTE_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_3CTE_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_3CTE_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_query = 0;
  PyObject *__pyx_v_recursive = 0;
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_query,&__pyx_n_s_recursive,&__pyx_n_s_columns,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_False));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        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_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 2169, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_query)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 2169, __pyx_L3_error)
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_recursive);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_columns);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2169, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_query = values[2];
    __pyx_v_recursive = values[3];
    __pyx_v_columns = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2169, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.CTE.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_3CTE___init__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_query, __pyx_v_recursive, __pyx_v_columns);

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

static PyObject *__pyx_pf_7sweepea_3CTE___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_query, PyObject *__pyx_v_recursive, PyObject *__pyx_v_columns) {
  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);

  /* "sweepea.pyx":2170
 * class CTE(Source):
 *     def __init__(self, name, query, recursive=False, columns=None):
 *         self._alias = name             # <<<<<<<<<<<<<<
 *         self._nested_cte_list = query._cte_list
 *         query._cte_list = ()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_alias_2, __pyx_v_name) < 0) __PYX_ERR(0, 2170, __pyx_L1_error)

  /* "sweepea.pyx":2171
 *     def __init__(self, name, query, recursive=False, columns=None):
 *         self._alias = name
 *         self._nested_cte_list = query._cte_list             # <<<<<<<<<<<<<<
 *         query._cte_list = ()
 *         self._query = query
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_query, __pyx_n_s_cte_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nested_cte_list, __pyx_t_1) < 0) __PYX_ERR(0, 2171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2172
 *         self._alias = name
 *         self._nested_cte_list = query._cte_list
 *         query._cte_list = ()             # <<<<<<<<<<<<<<
 *         self._query = query
 *         self._recursive = recursive
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_query, __pyx_n_s_cte_list, __pyx_empty_tuple) < 0) __PYX_ERR(0, 2172, __pyx_L1_error)

  /* "sweepea.pyx":2173
 *         self._nested_cte_list = query._cte_list
 *         query._cte_list = ()
 *         self._query = query             # <<<<<<<<<<<<<<
 *         self._recursive = recursive
 *         self._columns = columns
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_query_2, __pyx_v_query) < 0) __PYX_ERR(0, 2173, __pyx_L1_error)

  /* "sweepea.pyx":2174
 *         query._cte_list = ()
 *         self._query = query
 *         self._recursive = recursive             # <<<<<<<<<<<<<<
 *         self._columns = columns
 *         super(CTE, self).__init__(alias=name)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_recursive_2, __pyx_v_recursive) < 0) __PYX_ERR(0, 2174, __pyx_L1_error)

  /* "sweepea.pyx":2175
 *         self._query = query
 *         self._recursive = recursive
 *         self._columns = columns             # <<<<<<<<<<<<<<
 *         super(CTE, self).__init__(alias=name)
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_columns_2, __pyx_v_columns) < 0) __PYX_ERR(0, 2175, __pyx_L1_error)

  /* "sweepea.pyx":2176
 *         self._recursive = recursive
 *         self._columns = columns
 *         super(CTE, self).__init__(alias=name)             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_CTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_alias, __pyx_v_name) < 0) __PYX_ERR(0, 2176, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "sweepea.pyx":2169
 * 
 * class CTE(Source):
 *     def __init__(self, name, query, recursive=False, columns=None):             # <<<<<<<<<<<<<<
 *         self._alias = name
 *         self._nested_cte_list = query._cte_list
 */

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

/* "sweepea.pyx":2178
 *         super(CTE, self).__init__(alias=name)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.sql(Entity(self._alias))
 *         if ctx.scope == SCOPE_CTE:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_3CTE_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_3CTE_3__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_3CTE_3__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_3CTE_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2178, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2178, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2178, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.CTE.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2178, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_3CTE_2__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_3CTE_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2179
 * 
 *     def __sql__(self, Context ctx):
 *         ctx.sql(Entity(self._alias))             # <<<<<<<<<<<<<<
 *         if ctx.scope == SCOPE_CTE:
 *             if self._columns:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_alias_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2179, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2179, __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_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2179, __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_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2180
 *     def __sql__(self, Context ctx):
 *         ctx.sql(Entity(self._alias))
 *         if ctx.scope == SCOPE_CTE:             # <<<<<<<<<<<<<<
 *             if self._columns:
 *                 ctx.literal(' ').sql(EnclosedList(self._columns))
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ctx->scope); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCOPE_CTE); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2180, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_6) {

    /* "sweepea.pyx":2181
 *         ctx.sql(Entity(self._alias))
 *         if ctx.scope == SCOPE_CTE:
 *             if self._columns:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' ').sql(EnclosedList(self._columns))
 *             ctx.literal(' AS (')
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_columns_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 2181, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {

      /* "sweepea.pyx":2182
 *         if ctx.scope == SCOPE_CTE:
 *             if self._columns:
 *                 ctx.literal(' ').sql(EnclosedList(self._columns))             # <<<<<<<<<<<<<<
 *             ctx.literal(' AS (')
 *             with ctx.scope_normal():
 */
      __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s__57, 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EnclosedList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_columns_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2182, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2182, __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_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2182, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_5)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_5), __pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "sweepea.pyx":2181
 *         ctx.sql(Entity(self._alias))
 *         if ctx.scope == SCOPE_CTE:
 *             if self._columns:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' ').sql(EnclosedList(self._columns))
 *             ctx.literal(' AS (')
 */
    }

    /* "sweepea.pyx":2183
 *             if self._columns:
 *                 ctx.literal(' ').sql(EnclosedList(self._columns))
 *             ctx.literal(' AS (')             # <<<<<<<<<<<<<<
 *             with ctx.scope_normal():
 *                 ctx.sql(self._query)
 */
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_AS_2, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":2184
 *                 ctx.literal(' ').sql(EnclosedList(self._columns))
 *             ctx.literal(' AS (')
 *             with ctx.scope_normal():             # <<<<<<<<<<<<<<
 *                 ctx.sql(self._query)
 *             ctx.literal(')')
 */
    /*with:*/ {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ctx), __pyx_n_s_scope_normal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2184, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2184, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2184, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2184, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
        }
      }
      if (__pyx_t_7) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2184, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2184, __pyx_L5_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          /*try:*/ {

            /* "sweepea.pyx":2185
 *             ctx.literal(' AS (')
 *             with ctx.scope_normal():
 *                 ctx.sql(self._query)             # <<<<<<<<<<<<<<
 *             ctx.literal(')')
 *         return ctx
 */
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_query_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2185, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_2, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2185, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "sweepea.pyx":2184
 *                 ctx.literal(' ').sql(EnclosedList(self._columns))
 *             ctx.literal(' AS (')
 *             with ctx.scope_normal():             # <<<<<<<<<<<<<<
 *                 ctx.sql(self._query)
 *             ctx.literal(')')
 */
          }
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          goto __pyx_L16_try_end;
          __pyx_L9_error:;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("sweepea.CTE.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_5) < 0) __PYX_ERR(0, 2184, __pyx_L11_except_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GOTREF(__pyx_t_5);
            __pyx_t_7 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2184, __pyx_L11_except_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2184, __pyx_L11_except_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (__pyx_t_6 < 0) __PYX_ERR(0, 2184, __pyx_L11_except_error)
            __pyx_t_13 = ((!(__pyx_t_6 != 0)) != 0);
            if (__pyx_t_13) {
              __Pyx_GIVEREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_2);
              __Pyx_XGIVEREF(__pyx_t_5);
              __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_2, __pyx_t_5);
              __pyx_t_1 = 0; __pyx_t_2 = 0; __pyx_t_5 = 0; 
              __PYX_ERR(0, 2184, __pyx_L11_except_error)
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            goto __pyx_L10_exception_handled;
          }
          __pyx_L11_except_error:;
          __Pyx_PyThreadState_assign
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          goto __pyx_L1_error;
          __pyx_L10_exception_handled:;
          __Pyx_PyThreadState_assign
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
          __pyx_L16_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_8) {
            __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__58, NULL);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2184, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }
          goto __pyx_L8;
        }
        __pyx_L8:;
      }
      goto __pyx_L20;
      __pyx_L5_error:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L1_error;
      __pyx_L20:;
    }

    /* "sweepea.pyx":2186
 *             with ctx.scope_normal():
 *                 ctx.sql(self._query)
 *             ctx.literal(')')             # <<<<<<<<<<<<<<
 *         return ctx
 * 
 */
    __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s__53, 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "sweepea.pyx":2180
 *     def __sql__(self, Context ctx):
 *         ctx.sql(Entity(self._alias))
 *         if ctx.scope == SCOPE_CTE:             # <<<<<<<<<<<<<<
 *             if self._columns:
 *                 ctx.literal(' ').sql(EnclosedList(self._columns))
 */
  }

  /* "sweepea.pyx":2187
 *                 ctx.sql(self._query)
 *             ctx.literal(')')
 *         return ctx             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
  __pyx_r = ((PyObject *)__pyx_v_ctx);
  goto __pyx_L0;

  /* "sweepea.pyx":2178
 *         super(CTE, self).__init__(alias=name)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.sql(Entity(self._alias))
 *         if ctx.scope == SCOPE_CTE:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("sweepea.CTE.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2191
 * 
 * class EntityBase(Node):
 *     def alias(self, name):             # <<<<<<<<<<<<<<
 *         return Alias(self, name)
 *     def __inv__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10EntityBase_1alias(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10EntityBase_1alias = {"alias", (PyCFunction)__pyx_pw_7sweepea_10EntityBase_1alias, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10EntityBase_1alias(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("alias (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        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_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("alias", 1, 2, 2, 1); __PYX_ERR(0, 2191, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "alias") < 0)) __PYX_ERR(0, 2191, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("alias", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2191, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.EntityBase.alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10EntityBase_alias(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_7sweepea_10EntityBase_alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("alias", 0);

  /* "sweepea.pyx":2192
 * class EntityBase(Node):
 *     def alias(self, name):
 *         return Alias(self, name)             # <<<<<<<<<<<<<<
 *     def __inv__(self):
 *         return Negated(self)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Alias); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2192, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_name);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2192, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2191
 * 
 * class EntityBase(Node):
 *     def alias(self, name):             # <<<<<<<<<<<<<<
 *         return Alias(self, name)
 *     def __inv__(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_5);
  __Pyx_AddTraceback("sweepea.EntityBase.alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2193
 *     def alias(self, name):
 *         return Alias(self, name)
 *     def __inv__(self):             # <<<<<<<<<<<<<<
 *         return Negated(self)
 *     def __eq__(self, other):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10EntityBase_3__inv__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10EntityBase_3__inv__ = {"__inv__", (PyCFunction)__pyx_pw_7sweepea_10EntityBase_3__inv__, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_10EntityBase_3__inv__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__inv__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_10EntityBase_2__inv__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_10EntityBase_2__inv__(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;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__inv__", 0);

  /* "sweepea.pyx":2194
 *         return Alias(self, name)
 *     def __inv__(self):
 *         return Negated(self)             # <<<<<<<<<<<<<<
 *     def __eq__(self, other):
 *         return Expression(self, '=', other)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Negated); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2194, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2194, __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_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2194, __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;

  /* "sweepea.pyx":2193
 *     def alias(self, name):
 *         return Alias(self, name)
 *     def __inv__(self):             # <<<<<<<<<<<<<<
 *         return Negated(self)
 *     def __eq__(self, other):
 */

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

/* "sweepea.pyx":2195
 *     def __inv__(self):
 *         return Negated(self)
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return Expression(self, '=', other)
 *     def __ne__(self, other):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10EntityBase_5__eq__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10EntityBase_5__eq__ = {"__eq__", (PyCFunction)__pyx_pw_7sweepea_10EntityBase_5__eq__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10EntityBase_5__eq__(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("__eq__ (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("__eq__", 1, 2, 2, 1); __PYX_ERR(0, 2195, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__eq__") < 0)) __PYX_ERR(0, 2195, __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("__eq__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2195, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.EntityBase.__eq__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10EntityBase_4__eq__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_7sweepea_10EntityBase_4__eq__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__eq__", 0);

  /* "sweepea.pyx":2196
 *         return Negated(self)
 *     def __eq__(self, other):
 *         return Expression(self, '=', other)             # <<<<<<<<<<<<<<
 *     def __ne__(self, other):
 *         return Expression(self, '!=', other)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
  __Pyx_INCREF(__pyx_kp_s__59);
  __Pyx_GIVEREF(__pyx_kp_s__59);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_kp_s__59);
  __Pyx_INCREF(__pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_other);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2196, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2195
 *     def __inv__(self):
 *         return Negated(self)
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return Expression(self, '=', other)
 *     def __ne__(self, other):
 */

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

/* "sweepea.pyx":2197
 *     def __eq__(self, other):
 *         return Expression(self, '=', other)
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return Expression(self, '!=', other)
 *     def __neg__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10EntityBase_7__ne__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10EntityBase_7__ne__ = {"__ne__", (PyCFunction)__pyx_pw_7sweepea_10EntityBase_7__ne__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10EntityBase_7__ne__(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("__ne__ (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("__ne__", 1, 2, 2, 1); __PYX_ERR(0, 2197, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__ne__") < 0)) __PYX_ERR(0, 2197, __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("__ne__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2197, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.EntityBase.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10EntityBase_6__ne__(__pyx_self, __pyx_v_self, __pyx_v_other);

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

static PyObject *__pyx_pf_7sweepea_10EntityBase_6__ne__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__ne__", 0);

  /* "sweepea.pyx":2198
 *         return Expression(self, '=', other)
 *     def __ne__(self, other):
 *         return Expression(self, '!=', other)             # <<<<<<<<<<<<<<
 *     def __neg__(self):
 *         return self.desc()
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
  __Pyx_INCREF(__pyx_kp_s__60);
  __Pyx_GIVEREF(__pyx_kp_s__60);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_kp_s__60);
  __Pyx_INCREF(__pyx_v_other);
  __Pyx_GIVEREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_other);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2198, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2197
 *     def __eq__(self, other):
 *         return Expression(self, '=', other)
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return Expression(self, '!=', other)
 *     def __neg__(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_5);
  __Pyx_AddTraceback("sweepea.EntityBase.__ne__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2199
 *     def __ne__(self, other):
 *         return Expression(self, '!=', other)
 *     def __neg__(self):             # <<<<<<<<<<<<<<
 *         return self.desc()
 *     def __pos__(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10EntityBase_9__neg__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10EntityBase_9__neg__ = {"__neg__", (PyCFunction)__pyx_pw_7sweepea_10EntityBase_9__neg__, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_10EntityBase_9__neg__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__neg__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_10EntityBase_8__neg__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_10EntityBase_8__neg__(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("__neg__", 0);

  /* "sweepea.pyx":2200
 *         return Expression(self, '!=', other)
 *     def __neg__(self):
 *         return self.desc()             # <<<<<<<<<<<<<<
 *     def __pos__(self):
 *         return self.asc()
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_desc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2200, __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, 2200, __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;

  /* "sweepea.pyx":2199
 *     def __ne__(self, other):
 *         return Expression(self, '!=', other)
 *     def __neg__(self):             # <<<<<<<<<<<<<<
 *         return self.desc()
 *     def __pos__(self):
 */

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

/* "sweepea.pyx":2201
 *     def __neg__(self):
 *         return self.desc()
 *     def __pos__(self):             # <<<<<<<<<<<<<<
 *         return self.asc()
 *     def __e__(op, inv=False):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10EntityBase_11__pos__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10EntityBase_11__pos__ = {"__pos__", (PyCFunction)__pyx_pw_7sweepea_10EntityBase_11__pos__, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_10EntityBase_11__pos__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pos__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_10EntityBase_10__pos__(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_10EntityBase_10__pos__(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("__pos__", 0);

  /* "sweepea.pyx":2202
 *         return self.desc()
 *     def __pos__(self):
 *         return self.asc()             # <<<<<<<<<<<<<<
 *     def __e__(op, inv=False):
 *         def inner(self, rhs):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_asc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2202, __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, 2202, __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;

  /* "sweepea.pyx":2201
 *     def __neg__(self):
 *         return self.desc()
 *     def __pos__(self):             # <<<<<<<<<<<<<<
 *         return self.asc()
 *     def __e__(op, inv=False):
 */

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

/* "sweepea.pyx":2203
 *     def __pos__(self):
 *         return self.asc()
 *     def __e__(op, inv=False):             # <<<<<<<<<<<<<<
 *         def inner(self, rhs):
 *             if inv:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10EntityBase_13__e__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10EntityBase_13__e__ = {"__e__", (PyCFunction)__pyx_pw_7sweepea_10EntityBase_13__e__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10EntityBase_13__e__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_op = 0;
  PyObject *__pyx_v_inv = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__e__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,&__pyx_n_s_inv,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_op)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_inv);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__e__") < 0)) __PYX_ERR(0, 2203, __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_op = values[0];
    __pyx_v_inv = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__e__", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2203, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.EntityBase.__e__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10EntityBase_12__e__(__pyx_self, __pyx_v_op, __pyx_v_inv);

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

/* "sweepea.pyx":2204
 *         return self.asc()
 *     def __e__(op, inv=False):
 *         def inner(self, rhs):             # <<<<<<<<<<<<<<
 *             if inv:
 *                 return Expression(rhs, op, self)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10EntityBase_5__e___1inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10EntityBase_5__e___1inner = {"inner", (PyCFunction)__pyx_pw_7sweepea_10EntityBase_5__e___1inner, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10EntityBase_5__e___1inner(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_rhs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("inner (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_rhs,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_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("inner", 1, 2, 2, 1); __PYX_ERR(0, 2204, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "inner") < 0)) __PYX_ERR(0, 2204, __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_rhs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("inner", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2204, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.EntityBase.__e__.inner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10EntityBase_5__e___inner(__pyx_self, __pyx_v_self, __pyx_v_rhs);

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

static PyObject *__pyx_pf_7sweepea_10EntityBase_5__e___inner(PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__ *__pyx_cur_scope;
  struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__ *__pyx_outer_scope;
  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;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("inner", 0);
  __pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "sweepea.pyx":2205
 *     def __e__(op, inv=False):
 *         def inner(self, rhs):
 *             if inv:             # <<<<<<<<<<<<<<
 *                 return Expression(rhs, op, self)
 *             return Expression(self, op, rhs)
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_inv)) { __Pyx_RaiseClosureNameError("inv"); __PYX_ERR(0, 2205, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_cur_scope->__pyx_v_inv); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2205, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "sweepea.pyx":2206
 *         def inner(self, rhs):
 *             if inv:
 *                 return Expression(rhs, op, self)             # <<<<<<<<<<<<<<
 *             return Expression(self, op, rhs)
 *         return inner
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Expression); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (unlikely(!__pyx_cur_scope->__pyx_v_op)) { __Pyx_RaiseClosureNameError("op"); __PYX_ERR(0, 2206, __pyx_L1_error) }
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_5 = 1;
      }
    }
    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_rhs);
    __Pyx_GIVEREF(__pyx_v_rhs);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_rhs);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_op);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_op);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_cur_scope->__pyx_v_op);
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_self);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "sweepea.pyx":2205
 *     def __e__(op, inv=False):
 *         def inner(self, rhs):
 *             if inv:             # <<<<<<<<<<<<<<
 *                 return Expression(rhs, op, self)
 *             return Expression(self, op, rhs)
 */
  }

  /* "sweepea.pyx":2207
 *             if inv:
 *                 return Expression(rhs, op, self)
 *             return Expression(self, op, rhs)             # <<<<<<<<<<<<<<
 *         return inner
 *     __and__ = __e__('AND')
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Expression); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (unlikely(!__pyx_cur_scope->__pyx_v_op)) { __Pyx_RaiseClosureNameError("op"); __PYX_ERR(0, 2207, __pyx_L1_error) }
  __pyx_t_6 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_6) {
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_v_self);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_op);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_op);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_cur_scope->__pyx_v_op);
  __Pyx_INCREF(__pyx_v_rhs);
  __Pyx_GIVEREF(__pyx_v_rhs);
  PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, __pyx_v_rhs);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2207, __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_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2204
 *         return self.asc()
 *     def __e__(op, inv=False):
 *         def inner(self, rhs):             # <<<<<<<<<<<<<<
 *             if inv:
 *                 return Expression(rhs, op, self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("sweepea.EntityBase.__e__.inner", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2203
 *     def __pos__(self):
 *         return self.asc()
 *     def __e__(op, inv=False):             # <<<<<<<<<<<<<<
 *         def inner(self, rhs):
 *             if inv:
 */

static PyObject *__pyx_pf_7sweepea_10EntityBase_12__e__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_op, PyObject *__pyx_v_inv) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__ *__pyx_cur_scope;
  PyObject *__pyx_v_inner = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__e__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__ *)__pyx_tp_new_7sweepea___pyx_scope_struct_13___e__(__pyx_ptype_7sweepea___pyx_scope_struct_13___e__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_op = __pyx_v_op;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_op);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_op);
  __pyx_cur_scope->__pyx_v_inv = __pyx_v_inv;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_inv);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_inv);

  /* "sweepea.pyx":2204
 *         return self.asc()
 *     def __e__(op, inv=False):
 *         def inner(self, rhs):             # <<<<<<<<<<<<<<
 *             if inv:
 *                 return Expression(rhs, op, self)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10EntityBase_5__e___1inner, 0, __pyx_n_s_EntityBase___e___locals_inner, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__62)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_inner = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":2208
 *                 return Expression(rhs, op, self)
 *             return Expression(self, op, rhs)
 *         return inner             # <<<<<<<<<<<<<<
 *     __and__ = __e__('AND')
 *     __or__ = __e__('OR')
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_inner);
  __pyx_r = __pyx_v_inner;
  goto __pyx_L0;

  /* "sweepea.pyx":2203
 *     def __pos__(self):
 *         return self.asc()
 *     def __e__(op, inv=False):             # <<<<<<<<<<<<<<
 *         def inner(self, rhs):
 *             if inv:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.EntityBase.__e__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_inner);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2231
 *     in_ = __e__('IN')
 *     not_in = __e__('NOT IN')
 *     def is_null(self, is_null=True):             # <<<<<<<<<<<<<<
 *         return Expression(self, ('IS' if is_null else 'IS NOT'), None)
 *     def between(self, lo, hi):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10EntityBase_15is_null(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10EntityBase_15is_null = {"is_null", (PyCFunction)__pyx_pw_7sweepea_10EntityBase_15is_null, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10EntityBase_15is_null(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_is_null = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("is_null (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_is_null,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_True));
    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_is_null);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "is_null") < 0)) __PYX_ERR(0, 2231, __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_is_null = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("is_null", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2231, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.EntityBase.is_null", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10EntityBase_14is_null(__pyx_self, __pyx_v_self, __pyx_v_is_null);

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

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

  /* "sweepea.pyx":2232
 *     not_in = __e__('NOT IN')
 *     def is_null(self, is_null=True):
 *         return Expression(self, ('IS' if is_null else 'IS NOT'), None)             # <<<<<<<<<<<<<<
 *     def between(self, lo, hi):
 *         return Expression(self, 'BETWEEN', Expression(lo, 'AND', hi, True))
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_is_null); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2232, __pyx_L1_error)
  if (__pyx_t_4) {
    __Pyx_INCREF(__pyx_n_s_IS);
    __pyx_t_3 = __pyx_n_s_IS;
  } else {
    __Pyx_INCREF(__pyx_kp_s_IS_NOT);
    __pyx_t_3 = __pyx_kp_s_IS_NOT;
  }
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, Py_None);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2231
 *     in_ = __e__('IN')
 *     not_in = __e__('NOT IN')
 *     def is_null(self, is_null=True):             # <<<<<<<<<<<<<<
 *         return Expression(self, ('IS' if is_null else 'IS NOT'), None)
 *     def between(self, lo, hi):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("sweepea.EntityBase.is_null", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2233
 *     def is_null(self, is_null=True):
 *         return Expression(self, ('IS' if is_null else 'IS NOT'), None)
 *     def between(self, lo, hi):             # <<<<<<<<<<<<<<
 *         return Expression(self, 'BETWEEN', Expression(lo, 'AND', hi, True))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10EntityBase_17between(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10EntityBase_17between = {"between", (PyCFunction)__pyx_pw_7sweepea_10EntityBase_17between, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10EntityBase_17between(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_lo = 0;
  PyObject *__pyx_v_hi = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("between (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_lo,&__pyx_n_s_hi,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_lo)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("between", 1, 3, 3, 1); __PYX_ERR(0, 2233, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_hi)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("between", 1, 3, 3, 2); __PYX_ERR(0, 2233, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "between") < 0)) __PYX_ERR(0, 2233, __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_lo = values[1];
    __pyx_v_hi = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("between", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2233, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.EntityBase.between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10EntityBase_16between(__pyx_self, __pyx_v_self, __pyx_v_lo, __pyx_v_hi);

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

static PyObject *__pyx_pf_7sweepea_10EntityBase_16between(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_lo, PyObject *__pyx_v_hi) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("between", 0);

  /* "sweepea.pyx":2234
 *         return Expression(self, ('IS' if is_null else 'IS NOT'), None)
 *     def between(self, lo, hi):
 *         return Expression(self, 'BETWEEN', Expression(lo, 'AND', hi, True))             # <<<<<<<<<<<<<<
 * 
 *     def asc(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Expression); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Expression); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_5) {
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  }
  __Pyx_INCREF(__pyx_v_lo);
  __Pyx_GIVEREF(__pyx_v_lo);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_lo);
  __Pyx_INCREF(__pyx_n_s_AND);
  __Pyx_GIVEREF(__pyx_n_s_AND);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_AND);
  __Pyx_INCREF(__pyx_v_hi);
  __Pyx_GIVEREF(__pyx_v_hi);
  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_hi);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, Py_True);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_self);
  __Pyx_INCREF(__pyx_n_s_BETWEEN);
  __Pyx_GIVEREF(__pyx_n_s_BETWEEN);
  PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_n_s_BETWEEN);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2233
 *     def is_null(self, is_null=True):
 *         return Expression(self, ('IS' if is_null else 'IS NOT'), None)
 *     def between(self, lo, hi):             # <<<<<<<<<<<<<<
 *         return Expression(self, 'BETWEEN', Expression(lo, 'AND', hi, True))
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("sweepea.EntityBase.between", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2236
 *         return Expression(self, 'BETWEEN', Expression(lo, 'AND', hi, True))
 * 
 *     def asc(self):             # <<<<<<<<<<<<<<
 *         return Asc(self)
 *     def desc(self):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10EntityBase_19asc(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10EntityBase_19asc = {"asc", (PyCFunction)__pyx_pw_7sweepea_10EntityBase_19asc, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_10EntityBase_19asc(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("asc (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_10EntityBase_18asc(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_10EntityBase_18asc(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;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("asc", 0);

  /* "sweepea.pyx":2237
 * 
 *     def asc(self):
 *         return Asc(self)             # <<<<<<<<<<<<<<
 *     def desc(self):
 *         return Desc(self)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Asc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2237, __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_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2237, __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;

  /* "sweepea.pyx":2236
 *         return Expression(self, 'BETWEEN', Expression(lo, 'AND', hi, True))
 * 
 *     def asc(self):             # <<<<<<<<<<<<<<
 *         return Asc(self)
 *     def desc(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("sweepea.EntityBase.asc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2238
 *     def asc(self):
 *         return Asc(self)
 *     def desc(self):             # <<<<<<<<<<<<<<
 *         return Desc(self)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10EntityBase_21desc(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10EntityBase_21desc = {"desc", (PyCFunction)__pyx_pw_7sweepea_10EntityBase_21desc, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_10EntityBase_21desc(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("desc (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_10EntityBase_20desc(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_10EntityBase_20desc(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;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("desc", 0);

  /* "sweepea.pyx":2239
 *         return Asc(self)
 *     def desc(self):
 *         return Desc(self)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Desc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2239, __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_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2239, __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;

  /* "sweepea.pyx":2238
 *     def asc(self):
 *         return Asc(self)
 *     def desc(self):             # <<<<<<<<<<<<<<
 *         return Desc(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("sweepea.EntityBase.desc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2243
 * 
 * class Value(EntityBase):
 *     def __init__(self, value):             # <<<<<<<<<<<<<<
 *         self.value = value
 *         self.multi = isinstance(self.value, (list, tuple))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Value_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Value_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_5Value_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Value_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_value,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_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 2243, __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, 2243, __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_value = 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, 2243, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Value.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Value___init__(__pyx_self, __pyx_v_self, __pyx_v_value);

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

static PyObject *__pyx_pf_7sweepea_5Value___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_item = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":2244
 * class Value(EntityBase):
 *     def __init__(self, value):
 *         self.value = value             # <<<<<<<<<<<<<<
 *         self.multi = isinstance(self.value, (list, tuple))
 *         if self.multi:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_value, __pyx_v_value) < 0) __PYX_ERR(0, 2244, __pyx_L1_error)

  /* "sweepea.pyx":2245
 *     def __init__(self, value):
 *         self.value = value
 *         self.multi = isinstance(self.value, (list, tuple))             # <<<<<<<<<<<<<<
 *         if self.multi:
 *             self.bind_values = []
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyList_Check(__pyx_t_1); 
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (!__pyx_t_4) {
  } else {
    __pyx_t_2 = __pyx_t_4;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_4 = PyTuple_Check(__pyx_t_1); 
  __pyx_t_3 = (__pyx_t_4 != 0);
  __pyx_t_2 = __pyx_t_3;
  __pyx_L3_bool_binop_done:;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_multi, __pyx_t_1) < 0) __PYX_ERR(0, 2245, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2246
 *         self.value = value
 *         self.multi = isinstance(self.value, (list, tuple))
 *         if self.multi:             # <<<<<<<<<<<<<<
 *             self.bind_values = []
 *             for item in self.value:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2246, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2246, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "sweepea.pyx":2247
 *         self.multi = isinstance(self.value, (list, tuple))
 *         if self.multi:
 *             self.bind_values = []             # <<<<<<<<<<<<<<
 *             for item in self.value:
 *                 if isinstance(item, Node):
 */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_bind_values, __pyx_t_1) < 0) __PYX_ERR(0, 2247, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":2248
 *         if self.multi:
 *             self.bind_values = []
 *             for item in self.value:             # <<<<<<<<<<<<<<
 *                 if isinstance(item, Node):
 *                     self.bind_values.append(item)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2248, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2248, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2248, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 2248, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2248, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_1)) {
          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, 2248, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "sweepea.pyx":2249
 *             self.bind_values = []
 *             for item in self.value:
 *                 if isinstance(item, Node):             # <<<<<<<<<<<<<<
 *                     self.bind_values.append(item)
 *                 else:
 */
      __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_IsInstance(__pyx_v_item, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2249, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_3 = (__pyx_t_2 != 0);
      if (__pyx_t_3) {

        /* "sweepea.pyx":2250
 *             for item in self.value:
 *                 if isinstance(item, Node):
 *                     self.bind_values.append(item)             # <<<<<<<<<<<<<<
 *                 else:
 *                     self.bind_values.append(Value(item))
 */
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2250, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_item); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 2250, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "sweepea.pyx":2249
 *             self.bind_values = []
 *             for item in self.value:
 *                 if isinstance(item, Node):             # <<<<<<<<<<<<<<
 *                     self.bind_values.append(item)
 *                 else:
 */
        goto __pyx_L8;
      }

      /* "sweepea.pyx":2252
 *                     self.bind_values.append(item)
 *                 else:
 *                     self.bind_values.append(Value(item))             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
      /*else*/ {
        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2252, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_Value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2252, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        if (!__pyx_t_11) {
          __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_item); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2252, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
        } else {
          __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2252, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
          __Pyx_INCREF(__pyx_v_item);
          __Pyx_GIVEREF(__pyx_v_item);
          PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_item);
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2252, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_8 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_9); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 2252, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
      __pyx_L8:;

      /* "sweepea.pyx":2248
 *         if self.multi:
 *             self.bind_values = []
 *             for item in self.value:             # <<<<<<<<<<<<<<
 *                 if isinstance(item, Node):
 *                     self.bind_values.append(item)
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "sweepea.pyx":2246
 *         self.value = value
 *         self.multi = isinstance(self.value, (list, tuple))
 *         if self.multi:             # <<<<<<<<<<<<<<
 *             self.bind_values = []
 *             for item in self.value:
 */
  }

  /* "sweepea.pyx":2243
 * 
 * class Value(EntityBase):
 *     def __init__(self, value):             # <<<<<<<<<<<<<<
 *         self.value = value
 *         self.multi = isinstance(self.value, (list, tuple))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("sweepea.Value.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2254
 *                     self.bind_values.append(Value(item))
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self.multi:
 *             return ctx.sql(EnclosedList(self.bind_values))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Value_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Value_3__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_5Value_3__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Value_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2254, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2254, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2254, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Value.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2254, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_5Value_2__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_5Value_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2255
 * 
 *     def __sql__(self, Context ctx):
 *         if self.multi:             # <<<<<<<<<<<<<<
 *             return ctx.sql(EnclosedList(self.bind_values))
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2255, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "sweepea.pyx":2256
 *     def __sql__(self, Context ctx):
 *         if self.multi:
 *             return ctx.sql(EnclosedList(self.bind_values))             # <<<<<<<<<<<<<<
 *         else:
 *             return ctx.literal('?').bind_value(self.value)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_EnclosedList); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind_values); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2256, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_1, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2256, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "sweepea.pyx":2255
 * 
 *     def __sql__(self, Context ctx):
 *         if self.multi:             # <<<<<<<<<<<<<<
 *             return ctx.sql(EnclosedList(self.bind_values))
 *         else:
 */
  }

  /* "sweepea.pyx":2258
 *             return ctx.sql(EnclosedList(self.bind_values))
 *         else:
 *             return ctx.literal('?').bind_value(self.value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s__63, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_value); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_3)->__pyx_vtab)->bind_value(((struct __pyx_obj_7sweepea_Context *)__pyx_t_3), __pyx_t_1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;
  }

  /* "sweepea.pyx":2254
 *                     self.bind_values.append(Value(item))
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self.multi:
 *             return ctx.sql(EnclosedList(self.bind_values))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("sweepea.Value.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2262
 * 
 * class Column(EntityBase):
 *     def __init__(self, table, name):             # <<<<<<<<<<<<<<
 *         self.table = table
 *         self.name = name
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Column_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Column_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_6Column_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Column_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_table = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_table,&__pyx_n_s_name,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_table)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 2262, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 2262, __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, 2262, __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_table = values[1];
    __pyx_v_name = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2262, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Column.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Column___init__(__pyx_self, __pyx_v_self, __pyx_v_table, __pyx_v_name);

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

static PyObject *__pyx_pf_7sweepea_6Column___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_table, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":2263
 * class Column(EntityBase):
 *     def __init__(self, table, name):
 *         self.table = table             # <<<<<<<<<<<<<<
 *         self.name = name
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_table, __pyx_v_table) < 0) __PYX_ERR(0, 2263, __pyx_L1_error)

  /* "sweepea.pyx":2264
 *     def __init__(self, table, name):
 *         self.table = table
 *         self.name = name             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 2264, __pyx_L1_error)

  /* "sweepea.pyx":2262
 * 
 * class Column(EntityBase):
 *     def __init__(self, table, name):             # <<<<<<<<<<<<<<
 *         self.table = table
 *         self.name = name
 */

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

/* "sweepea.pyx":2266
 *         self.name = name
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if ctx.scope == SCOPE_VALUES:
 *             return ctx.sql(Entity(self.name))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Column_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Column_3__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_6Column_3__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Column_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2266, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2266, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2266, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Column.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2266, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Column_2__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_6Column_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  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;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2267
 * 
 *     def __sql__(self, Context ctx):
 *         if ctx.scope == SCOPE_VALUES:             # <<<<<<<<<<<<<<
 *             return ctx.sql(Entity(self.name))
 *         else:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ctx->scope); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCOPE_VALUES); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "sweepea.pyx":2268
 *     def __sql__(self, Context ctx):
 *         if ctx.scope == SCOPE_VALUES:
 *             return ctx.sql(Entity(self.name))             # <<<<<<<<<<<<<<
 *         else:
 *             with ctx.scope_normal():
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2268, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
      __Pyx_GIVEREF(__pyx_t_1);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_3, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "sweepea.pyx":2267
 * 
 *     def __sql__(self, Context ctx):
 *         if ctx.scope == SCOPE_VALUES:             # <<<<<<<<<<<<<<
 *             return ctx.sql(Entity(self.name))
 *         else:
 */
  }

  /* "sweepea.pyx":2270
 *             return ctx.sql(Entity(self.name))
 *         else:
 *             with ctx.scope_normal():             # <<<<<<<<<<<<<<
 *                 return ctx.sql(self.table).literal('.').sql(Entity(self.name))
 * 
 */
  /*else*/ {
    /*with:*/ {
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ctx), __pyx_n_s_scope_normal); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2270, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2270, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_7 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2270, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2270, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (__pyx_t_1) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2270, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2270, __pyx_L4_error)
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          /*try:*/ {

            /* "sweepea.pyx":2271
 *         else:
 *             with ctx.scope_normal():
 *                 return ctx.sql(self.table).literal('.').sql(Entity(self.name))             # <<<<<<<<<<<<<<
 * 
 * 
 */
            __Pyx_XDECREF(__pyx_r);
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_table); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2271, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2271, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_3)->__pyx_vtab)->literal(((struct __pyx_obj_7sweepea_Context *)__pyx_t_3), __pyx_kp_s__64, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2271, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_Entity); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2271, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2271, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_5 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
              __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
              if (likely(__pyx_t_5)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
                __Pyx_INCREF(__pyx_t_5);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_6, function);
              }
            }
            if (!__pyx_t_5) {
              __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2271, __pyx_L8_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_GOTREF(__pyx_t_3);
            } else {
              __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2271, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_5); __pyx_t_5 = NULL;
              __Pyx_GIVEREF(__pyx_t_1);
              PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_1);
              __pyx_t_1 = 0;
              __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2271, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_2)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_2), __pyx_t_3, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2271, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_r = __pyx_t_6;
            __pyx_t_6 = 0;
            goto __pyx_L12_try_return;

            /* "sweepea.pyx":2270
 *             return ctx.sql(Entity(self.name))
 *         else:
 *             with ctx.scope_normal():             # <<<<<<<<<<<<<<
 *                 return ctx.sql(self.table).literal('.').sql(Entity(self.name))
 * 
 */
          }
          __pyx_L8_error:;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("sweepea.Column.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 2270, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_11 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2270, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_11, NULL);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2270, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (__pyx_t_4 < 0) __PYX_ERR(0, 2270, __pyx_L10_except_error)
            __pyx_t_13 = ((!(__pyx_t_4 != 0)) != 0);
            if (__pyx_t_13) {
              __Pyx_GIVEREF(__pyx_t_6);
              __Pyx_GIVEREF(__pyx_t_3);
              __Pyx_XGIVEREF(__pyx_t_2);
              __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_3, __pyx_t_2);
              __pyx_t_6 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
              __PYX_ERR(0, 2270, __pyx_L10_except_error)
            }
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_PyThreadState_assign
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          goto __pyx_L1_error;
          __pyx_L12_try_return:;
          __Pyx_PyThreadState_assign
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
          goto __pyx_L5_return;
          __pyx_L9_exception_handled:;
          __Pyx_PyThreadState_assign
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_7) {
            __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__65, NULL);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2270, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L5_return: {
          __pyx_t_10 = __pyx_r;
          __pyx_r = 0;
          if (__pyx_t_7) {
            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__66, NULL);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2270, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          __pyx_r = __pyx_t_10;
          __pyx_t_10 = 0;
          goto __pyx_L0;
        }
        __pyx_L7:;
      }
      goto __pyx_L19;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L1_error;
      __pyx_L19:;
    }
  }

  /* "sweepea.pyx":2266
 *         self.name = name
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if ctx.scope == SCOPE_VALUES:
 *             return ctx.sql(Entity(self.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_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("sweepea.Column.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2275
 * 
 * class Expression(EntityBase):
 *     def __init__(self, lhs, op, rhs, is_flat=False):             # <<<<<<<<<<<<<<
 *         if not isinstance(lhs, Node):
 *             lhs = Value(lhs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10Expression_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10Expression_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_10Expression_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10Expression_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_lhs = 0;
  PyObject *__pyx_v_op = 0;
  PyObject *__pyx_v_rhs = 0;
  PyObject *__pyx_v_is_flat = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_lhs,&__pyx_n_s_op,&__pyx_n_s_rhs,&__pyx_n_s_is_flat,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[4] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_lhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 1); __PYX_ERR(0, 2275, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 2); __PYX_ERR(0, 2275, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, 3); __PYX_ERR(0, 2275, __pyx_L3_error)
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_is_flat);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2275, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_lhs = values[1];
    __pyx_v_op = values[2];
    __pyx_v_rhs = values[3];
    __pyx_v_is_flat = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2275, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Expression.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10Expression___init__(__pyx_self, __pyx_v_self, __pyx_v_lhs, __pyx_v_op, __pyx_v_rhs, __pyx_v_is_flat);

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

static PyObject *__pyx_pf_7sweepea_10Expression___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_op, PyObject *__pyx_v_rhs, PyObject *__pyx_v_is_flat) {
  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;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_lhs);
  __Pyx_INCREF(__pyx_v_rhs);

  /* "sweepea.pyx":2276
 * class Expression(EntityBase):
 *     def __init__(self, lhs, op, rhs, is_flat=False):
 *         if not isinstance(lhs, Node):             # <<<<<<<<<<<<<<
 *             lhs = Value(lhs)
 *         if not isinstance(rhs, Node):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_lhs, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2276, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!(__pyx_t_2 != 0)) != 0);
  if (__pyx_t_3) {

    /* "sweepea.pyx":2277
 *     def __init__(self, lhs, op, rhs, is_flat=False):
 *         if not isinstance(lhs, Node):
 *             lhs = Value(lhs)             # <<<<<<<<<<<<<<
 *         if not isinstance(rhs, Node):
 *             rhs = Value(rhs)
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_lhs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2277, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2277, __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_lhs);
      __Pyx_GIVEREF(__pyx_v_lhs);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_lhs);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2277, __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_lhs, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "sweepea.pyx":2276
 * class Expression(EntityBase):
 *     def __init__(self, lhs, op, rhs, is_flat=False):
 *         if not isinstance(lhs, Node):             # <<<<<<<<<<<<<<
 *             lhs = Value(lhs)
 *         if not isinstance(rhs, Node):
 */
  }

  /* "sweepea.pyx":2278
 *         if not isinstance(lhs, Node):
 *             lhs = Value(lhs)
 *         if not isinstance(rhs, Node):             # <<<<<<<<<<<<<<
 *             rhs = Value(rhs)
 *         self.lhs = lhs
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_IsInstance(__pyx_v_rhs, __pyx_t_1); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = ((!(__pyx_t_3 != 0)) != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":2279
 *             lhs = Value(lhs)
 *         if not isinstance(rhs, Node):
 *             rhs = Value(rhs)             # <<<<<<<<<<<<<<
 *         self.lhs = lhs
 *         self.op = op
 */
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2279, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_rhs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_rhs);
      __Pyx_GIVEREF(__pyx_v_rhs);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_rhs);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2279, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_rhs, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "sweepea.pyx":2278
 *         if not isinstance(lhs, Node):
 *             lhs = Value(lhs)
 *         if not isinstance(rhs, Node):             # <<<<<<<<<<<<<<
 *             rhs = Value(rhs)
 *         self.lhs = lhs
 */
  }

  /* "sweepea.pyx":2280
 *         if not isinstance(rhs, Node):
 *             rhs = Value(rhs)
 *         self.lhs = lhs             # <<<<<<<<<<<<<<
 *         self.op = op
 *         self.rhs = rhs
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lhs, __pyx_v_lhs) < 0) __PYX_ERR(0, 2280, __pyx_L1_error)

  /* "sweepea.pyx":2281
 *             rhs = Value(rhs)
 *         self.lhs = lhs
 *         self.op = op             # <<<<<<<<<<<<<<
 *         self.rhs = rhs
 *         self._is_flat = is_flat
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_op, __pyx_v_op) < 0) __PYX_ERR(0, 2281, __pyx_L1_error)

  /* "sweepea.pyx":2282
 *         self.lhs = lhs
 *         self.op = op
 *         self.rhs = rhs             # <<<<<<<<<<<<<<
 *         self._is_flat = is_flat
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rhs, __pyx_v_rhs) < 0) __PYX_ERR(0, 2282, __pyx_L1_error)

  /* "sweepea.pyx":2283
 *         self.op = op
 *         self.rhs = rhs
 *         self._is_flat = is_flat             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_is_flat_2, __pyx_v_is_flat) < 0) __PYX_ERR(0, 2283, __pyx_L1_error)

  /* "sweepea.pyx":2275
 * 
 * class Expression(EntityBase):
 *     def __init__(self, lhs, op, rhs, is_flat=False):             # <<<<<<<<<<<<<<
 *         if not isinstance(lhs, Node):
 *             lhs = Value(lhs)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("sweepea.Expression.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_lhs);
  __Pyx_XDECREF(__pyx_v_rhs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2285
 *         self._is_flat = is_flat
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         with ctx(parentheses=not self._is_flat):
 *             return (ctx
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10Expression_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10Expression_3__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_10Expression_3__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10Expression_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2285, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2285, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2285, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Expression.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2285, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_10Expression_2__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_10Expression_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  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;
  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;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2286
 * 
 *     def __sql__(self, Context ctx):
 *         with ctx(parentheses=not self._is_flat):             # <<<<<<<<<<<<<<
 *             return (ctx
 *                     .sql(self.lhs)
 */
  /*with:*/ {
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_is_flat_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2286, __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, 2286, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyBool_FromLong((!__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_parentheses, __pyx_t_2) < 0) __PYX_ERR(0, 2286, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_ctx), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2286, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2286, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2286, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2286, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "sweepea.pyx":2287
 *     def __sql__(self, Context ctx):
 *         with ctx(parentheses=not self._is_flat):
 *             return (ctx             # <<<<<<<<<<<<<<
 *                     .sql(self.lhs)
 *                     .literal(' %s ' % self.op)
 */
          __Pyx_XDECREF(__pyx_r);

          /* "sweepea.pyx":2288
 *         with ctx(parentheses=not self._is_flat):
 *             return (ctx
 *                     .sql(self.lhs)             # <<<<<<<<<<<<<<
 *                     .literal(' %s ' % self.op)
 *                     .sql(self.rhs))
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lhs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2288, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_2, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2288, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "sweepea.pyx":2289
 *             return (ctx
 *                     .sql(self.lhs)
 *                     .literal(' %s ' % self.op)             # <<<<<<<<<<<<<<
 *                     .sql(self.rhs))
 * 
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_op); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2289, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_s_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2289, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_1)->__pyx_vtab)->literal(((struct __pyx_obj_7sweepea_Context *)__pyx_t_1), __pyx_t_5, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2289, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

          /* "sweepea.pyx":2290
 *                     .sql(self.lhs)
 *                     .literal(' %s ' % self.op)
 *                     .sql(self.rhs))             # <<<<<<<<<<<<<<
 * 
 * 
 */
          __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rhs); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2290, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_2)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_2), __pyx_t_5, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2290, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_r = __pyx_t_1;
          __pyx_t_1 = 0;
          goto __pyx_L11_try_return;

          /* "sweepea.pyx":2286
 * 
 *     def __sql__(self, Context ctx):
 *         with ctx(parentheses=not self._is_flat):             # <<<<<<<<<<<<<<
 *             return (ctx
 *                     .sql(self.lhs)
 */
        }
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("sweepea.Expression.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_5, &__pyx_t_2) < 0) __PYX_ERR(0, 2286, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_6 = PyTuple_Pack(3, __pyx_t_1, __pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2286, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2286, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_3 < 0) __PYX_ERR(0, 2286, __pyx_L9_except_error)
          __pyx_t_11 = ((!(__pyx_t_3 != 0)) != 0);
          if (__pyx_t_11) {
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_GIVEREF(__pyx_t_5);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestoreWithState(__pyx_t_1, __pyx_t_5, __pyx_t_2);
            __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_2 = 0; 
            __PYX_ERR(0, 2286, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L11_try_return:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L4_return;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_4) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__67, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2286, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L4_return: {
        __pyx_t_9 = __pyx_r;
        __pyx_r = 0;
        if (__pyx_t_4) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__68, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2286, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        __pyx_r = __pyx_t_9;
        __pyx_t_9 = 0;
        goto __pyx_L0;
      }
      __pyx_L6:;
    }
    goto __pyx_L18;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L1_error;
    __pyx_L18:;
  }

  /* "sweepea.pyx":2285
 *         self._is_flat = is_flat
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         with ctx(parentheses=not self._is_flat):
 *             return (ctx
 */

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

/* "sweepea.pyx":2294
 * 
 * class EntityWrapper(EntityBase):
 *     def __init__(self, entity, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self.entity = entity
 *         super(EntityWrapper, self).__init__(*args, **kwargs)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_13EntityWrapper_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_13EntityWrapper_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_13EntityWrapper_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_13EntityWrapper_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_entity = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_entity,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) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        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;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_entity)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, 1); __PYX_ERR(0, 2294, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 2294, __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_entity = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2294, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("sweepea.EntityWrapper.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_13EntityWrapper___init__(__pyx_self, __pyx_v_self, __pyx_v_entity, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7sweepea_13EntityWrapper___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_entity, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":2295
 * class EntityWrapper(EntityBase):
 *     def __init__(self, entity, *args, **kwargs):
 *         self.entity = entity             # <<<<<<<<<<<<<<
 *         super(EntityWrapper, self).__init__(*args, **kwargs)
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_entity, __pyx_v_entity) < 0) __PYX_ERR(0, 2295, __pyx_L1_error)

  /* "sweepea.pyx":2296
 *     def __init__(self, entity, *args, **kwargs):
 *         self.entity = entity
 *         super(EntityWrapper, self).__init__(*args, **kwargs)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntityWrapper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2296, __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_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2296, __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;

  /* "sweepea.pyx":2294
 * 
 * class EntityWrapper(EntityBase):
 *     def __init__(self, entity, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self.entity = entity
 *         super(EntityWrapper, self).__init__(*args, **kwargs)
 */

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

/* "sweepea.pyx":2300
 * 
 * class Alias(EntityWrapper):
 *     def __init__(self, entity, name):             # <<<<<<<<<<<<<<
 *         super(Alias, self).__init__(entity)
 *         self.name = name
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Alias_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Alias_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_5Alias_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Alias_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_entity = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_entity,&__pyx_n_s_name,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_entity)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 2300, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 2300, __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, 2300, __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_entity = values[1];
    __pyx_v_name = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2300, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Alias.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Alias___init__(__pyx_self, __pyx_v_self, __pyx_v_entity, __pyx_v_name);

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

static PyObject *__pyx_pf_7sweepea_5Alias___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_entity, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":2301
 * class Alias(EntityWrapper):
 *     def __init__(self, entity, name):
 *         super(Alias, self).__init__(entity)             # <<<<<<<<<<<<<<
 *         self.name = name
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Alias); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2301, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2301, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_entity);
    __Pyx_GIVEREF(__pyx_v_entity);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_entity);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2301, __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;

  /* "sweepea.pyx":2302
 *     def __init__(self, entity, name):
 *         super(Alias, self).__init__(entity)
 *         self.name = name             # <<<<<<<<<<<<<<
 * 
 *     def alias(self, name):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 2302, __pyx_L1_error)

  /* "sweepea.pyx":2300
 * 
 * class Alias(EntityWrapper):
 *     def __init__(self, entity, name):             # <<<<<<<<<<<<<<
 *         super(Alias, self).__init__(entity)
 *         self.name = 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_4);
  __Pyx_AddTraceback("sweepea.Alias.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2304
 *         self.name = name
 * 
 *     def alias(self, name):             # <<<<<<<<<<<<<<
 *         if not name:
 *             return self.entity
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Alias_3alias(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Alias_3alias = {"alias", (PyCFunction)__pyx_pw_7sweepea_5Alias_3alias, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Alias_3alias(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("alias (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        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_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("alias", 1, 2, 2, 1); __PYX_ERR(0, 2304, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "alias") < 0)) __PYX_ERR(0, 2304, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("alias", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2304, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Alias.alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Alias_2alias(__pyx_self, __pyx_v_self, __pyx_v_name);

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

static PyObject *__pyx_pf_7sweepea_5Alias_2alias(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("alias", 0);

  /* "sweepea.pyx":2305
 * 
 *     def alias(self, name):
 *         if not name:             # <<<<<<<<<<<<<<
 *             return self.entity
 *         self.name = name
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 2305, __pyx_L1_error)
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "sweepea.pyx":2306
 *     def alias(self, name):
 *         if not name:
 *             return self.entity             # <<<<<<<<<<<<<<
 *         self.name = name
 *         return self
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_entity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "sweepea.pyx":2305
 * 
 *     def alias(self, name):
 *         if not name:             # <<<<<<<<<<<<<<
 *             return self.entity
 *         self.name = name
 */
  }

  /* "sweepea.pyx":2307
 *         if not name:
 *             return self.entity
 *         self.name = name             # <<<<<<<<<<<<<<
 *         return self
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 2307, __pyx_L1_error)

  /* "sweepea.pyx":2308
 *             return self.entity
 *         self.name = name
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  /* "sweepea.pyx":2304
 *         self.name = name
 * 
 *     def alias(self, name):             # <<<<<<<<<<<<<<
 *         if not name:
 *             return self.entity
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("sweepea.Alias.alias", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2310
 *         return self
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return ctx.sql(self.entity).literal(' AS "%s"' % self.name)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Alias_5__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Alias_5__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_5Alias_5__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Alias_5__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2310, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2310, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2310, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Alias.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2310, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_5Alias_4__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_5Alias_4__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2311
 * 
 *     def __sql__(self, Context ctx):
 *         return ctx.sql(self.entity).literal(' AS "%s"' % self.name)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_AS_s, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_2)->__pyx_vtab)->literal(((struct __pyx_obj_7sweepea_Context *)__pyx_t_2), __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2310
 *         return self
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return ctx.sql(self.entity).literal(' AS "%s"' % self.name)
 * 
 */

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

/* "sweepea.pyx":2315
 * 
 * class Negated(EntityWrapper):
 *     def __invert__(self):             # <<<<<<<<<<<<<<
 *         return self.entity
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Negated_1__invert__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_7Negated_1__invert__ = {"__invert__", (PyCFunction)__pyx_pw_7sweepea_7Negated_1__invert__, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_7Negated_1__invert__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__invert__ (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_7Negated___invert__(__pyx_self, ((PyObject *)__pyx_v_self));

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

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

  /* "sweepea.pyx":2316
 * class Negated(EntityWrapper):
 *     def __invert__(self):
 *         return self.entity             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2315
 * 
 * class Negated(EntityWrapper):
 *     def __invert__(self):             # <<<<<<<<<<<<<<
 *         return self.entity
 * 
 */

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

/* "sweepea.pyx":2318
 *         return self.entity
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return ctx.literal(' NOT ').sql(self.entity)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_7Negated_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_7Negated_3__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_7Negated_3__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_7Negated_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2318, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2318, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2318, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Negated.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2318, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_7Negated_2__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_7Negated_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2319
 * 
 *     def __sql__(self, Context ctx):
 *         return ctx.literal(' NOT ').sql(self.entity)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_NOT, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_entity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_1)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_1), __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2318
 *         return self.entity
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return ctx.literal(' NOT ').sql(self.entity)
 * 
 */

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

/* "sweepea.pyx":2323
 * 
 * class Cast(EntityWrapper):
 *     def __init__(self, entity, cast):             # <<<<<<<<<<<<<<
 *         super(Cast, self).__init__(entity)
 *         self.cast = cast
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_4Cast_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_4Cast_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_4Cast_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_4Cast_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_entity = 0;
  PyObject *__pyx_v_cast = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_entity,&__pyx_n_s_cast,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_entity)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 2323, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_cast)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 2323, __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, 2323, __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_entity = values[1];
    __pyx_v_cast = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2323, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Cast.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_4Cast___init__(__pyx_self, __pyx_v_self, __pyx_v_entity, __pyx_v_cast);

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

static PyObject *__pyx_pf_7sweepea_4Cast___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_entity, PyObject *__pyx_v_cast) {
  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("__init__", 0);

  /* "sweepea.pyx":2324
 * class Cast(EntityWrapper):
 *     def __init__(self, entity, cast):
 *         super(Cast, self).__init__(entity)             # <<<<<<<<<<<<<<
 *         self.cast = cast
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Cast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_entity);
    __Pyx_GIVEREF(__pyx_v_entity);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_entity);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2324, __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;

  /* "sweepea.pyx":2325
 *     def __init__(self, entity, cast):
 *         super(Cast, self).__init__(entity)
 *         self.cast = cast             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cast, __pyx_v_cast) < 0) __PYX_ERR(0, 2325, __pyx_L1_error)

  /* "sweepea.pyx":2323
 * 
 * class Cast(EntityWrapper):
 *     def __init__(self, entity, cast):             # <<<<<<<<<<<<<<
 *         super(Cast, self).__init__(entity)
 *         self.cast = cast
 */

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

/* "sweepea.pyx":2327
 *         self.cast = cast
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return (ctx
 *                 .literal('CAST(')
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_4Cast_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_4Cast_3__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_4Cast_3__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_4Cast_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2327, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2327, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2327, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Cast.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2327, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_4Cast_2__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_4Cast_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2328
 * 
 *     def __sql__(self, Context ctx):
 *         return (ctx             # <<<<<<<<<<<<<<
 *                 .literal('CAST(')
 *                 .sql(self.entity)
 */
  __Pyx_XDECREF(__pyx_r);

  /* "sweepea.pyx":2329
 *     def __sql__(self, Context ctx):
 *         return (ctx
 *                 .literal('CAST(')             # <<<<<<<<<<<<<<
 *                 .sql(self.entity)
 *                 .literal(' AS %s)' % self.cast))
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_CAST, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "sweepea.pyx":2330
 *         return (ctx
 *                 .literal('CAST(')
 *                 .sql(self.entity)             # <<<<<<<<<<<<<<
 *                 .literal(' AS %s)' % self.cast))
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_entity); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_1)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_1), __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2330, __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;

  /* "sweepea.pyx":2331
 *                 .literal('CAST(')
 *                 .sql(self.entity)
 *                 .literal(' AS %s)' % self.cast))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_cast); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_AS_s_2, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_3)->__pyx_vtab)->literal(((struct __pyx_obj_7sweepea_Context *)__pyx_t_3), __pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2327
 *         self.cast = cast
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return (ctx
 *                 .literal('CAST(')
 */

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

/* "sweepea.pyx":2335
 * 
 * class Ordering(EntityWrapper):
 *     def __init__(self, entity, direction, collation=None, nulls=None):             # <<<<<<<<<<<<<<
 *         super(Ordering, self).__init__(entity)
 *         self.direction = direction
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Ordering_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_8Ordering_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_8Ordering_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_8Ordering_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_entity = 0;
  PyObject *__pyx_v_direction = 0;
  PyObject *__pyx_v_collation = 0;
  PyObject *__pyx_v_nulls = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_entity,&__pyx_n_s_direction,&__pyx_n_s_collation,&__pyx_n_s_nulls,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        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_entity)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); __PYX_ERR(0, 2335, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_direction)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); __PYX_ERR(0, 2335, __pyx_L3_error)
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_collation);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nulls);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2335, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_entity = values[1];
    __pyx_v_direction = values[2];
    __pyx_v_collation = values[3];
    __pyx_v_nulls = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2335, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Ordering.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Ordering___init__(__pyx_self, __pyx_v_self, __pyx_v_entity, __pyx_v_direction, __pyx_v_collation, __pyx_v_nulls);

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

static PyObject *__pyx_pf_7sweepea_8Ordering___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_entity, PyObject *__pyx_v_direction, PyObject *__pyx_v_collation, PyObject *__pyx_v_nulls) {
  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("__init__", 0);

  /* "sweepea.pyx":2336
 * class Ordering(EntityWrapper):
 *     def __init__(self, entity, direction, collation=None, nulls=None):
 *         super(Ordering, self).__init__(entity)             # <<<<<<<<<<<<<<
 *         self.direction = direction
 *         self.collation = collation
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Ordering); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_entity);
    __Pyx_GIVEREF(__pyx_v_entity);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_entity);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2336, __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;

  /* "sweepea.pyx":2337
 *     def __init__(self, entity, direction, collation=None, nulls=None):
 *         super(Ordering, self).__init__(entity)
 *         self.direction = direction             # <<<<<<<<<<<<<<
 *         self.collation = collation
 *         self.nulls = nulls
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_direction, __pyx_v_direction) < 0) __PYX_ERR(0, 2337, __pyx_L1_error)

  /* "sweepea.pyx":2338
 *         super(Ordering, self).__init__(entity)
 *         self.direction = direction
 *         self.collation = collation             # <<<<<<<<<<<<<<
 *         self.nulls = nulls
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_collation, __pyx_v_collation) < 0) __PYX_ERR(0, 2338, __pyx_L1_error)

  /* "sweepea.pyx":2339
 *         self.direction = direction
 *         self.collation = collation
 *         self.nulls = nulls             # <<<<<<<<<<<<<<
 * 
 *     def collate(self, collation=None):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nulls, __pyx_v_nulls) < 0) __PYX_ERR(0, 2339, __pyx_L1_error)

  /* "sweepea.pyx":2335
 * 
 * class Ordering(EntityWrapper):
 *     def __init__(self, entity, direction, collation=None, nulls=None):             # <<<<<<<<<<<<<<
 *         super(Ordering, self).__init__(entity)
 *         self.direction = direction
 */

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

/* "sweepea.pyx":2341
 *         self.nulls = nulls
 * 
 *     def collate(self, collation=None):             # <<<<<<<<<<<<<<
 *         return Ordering(self.entity, self.direction, collation, self.nulls)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Ordering_3collate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_8Ordering_3collate = {"collate", (PyCFunction)__pyx_pw_7sweepea_8Ordering_3collate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_8Ordering_3collate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_collation = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("collate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_collation,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_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_collation);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "collate") < 0)) __PYX_ERR(0, 2341, __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_collation = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("collate", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2341, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Ordering.collate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Ordering_2collate(__pyx_self, __pyx_v_self, __pyx_v_collation);

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

static PyObject *__pyx_pf_7sweepea_8Ordering_2collate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_collation) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("collate", 0);

  /* "sweepea.pyx":2342
 * 
 *     def collate(self, collation=None):
 *         return Ordering(self.entity, self.direction, collation, self.nulls)             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Ordering); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_entity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_direction); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nulls); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2342, __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_3);
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_collation);
  __Pyx_GIVEREF(__pyx_v_collation);
  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_collation);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2341
 *         self.nulls = nulls
 * 
 *     def collate(self, collation=None):             # <<<<<<<<<<<<<<
 *         return Ordering(self.entity, self.direction, collation, self.nulls)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("sweepea.Ordering.collate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2344
 *         return Ordering(self.entity, self.direction, collation, self.nulls)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.sql(self.entity).literal(' %s' % self.direction)
 *         if self.collation:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Ordering_5__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_8Ordering_5__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_8Ordering_5__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_8Ordering_5__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2344, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2344, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2344, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Ordering.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2344, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_8Ordering_4__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_8Ordering_4__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  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;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2345
 * 
 *     def __sql__(self, Context ctx):
 *         ctx.sql(self.entity).literal(' %s' % self.direction)             # <<<<<<<<<<<<<<
 *         if self.collation:
 *             ctx.literal(' COLLATE %s' % self.collation)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_entity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_direction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_2)->__pyx_vtab)->literal(((struct __pyx_obj_7sweepea_Context *)__pyx_t_2), __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2346
 *     def __sql__(self, Context ctx):
 *         ctx.sql(self.entity).literal(' %s' % self.direction)
 *         if self.collation:             # <<<<<<<<<<<<<<
 *             ctx.literal(' COLLATE %s' % self.collation)
 *         if self.nulls:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "sweepea.pyx":2347
 *         ctx.sql(self.entity).literal(' %s' % self.direction)
 *         if self.collation:
 *             ctx.literal(' COLLATE %s' % self.collation)             # <<<<<<<<<<<<<<
 *         if self.nulls:
 *             ctx.literal(' NULLS %s' % self.nulls)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_collation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_COLLATE_s, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2347, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":2346
 *     def __sql__(self, Context ctx):
 *         ctx.sql(self.entity).literal(' %s' % self.direction)
 *         if self.collation:             # <<<<<<<<<<<<<<
 *             ctx.literal(' COLLATE %s' % self.collation)
 *         if self.nulls:
 */
  }

  /* "sweepea.pyx":2348
 *         if self.collation:
 *             ctx.literal(' COLLATE %s' % self.collation)
 *         if self.nulls:             # <<<<<<<<<<<<<<
 *             ctx.literal(' NULLS %s' % self.nulls)
 *         return ctx
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nulls); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2348, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "sweepea.pyx":2349
 *             ctx.literal(' COLLATE %s' % self.collation)
 *         if self.nulls:
 *             ctx.literal(' NULLS %s' % self.nulls)             # <<<<<<<<<<<<<<
 *         return ctx
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nulls); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_NULLS_s, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2349, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":2348
 *         if self.collation:
 *             ctx.literal(' COLLATE %s' % self.collation)
 *         if self.nulls:             # <<<<<<<<<<<<<<
 *             ctx.literal(' NULLS %s' % self.nulls)
 *         return ctx
 */
  }

  /* "sweepea.pyx":2350
 *         if self.nulls:
 *             ctx.literal(' NULLS %s' % self.nulls)
 *         return ctx             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
  __pyx_r = ((PyObject *)__pyx_v_ctx);
  goto __pyx_L0;

  /* "sweepea.pyx":2344
 *         return Ordering(self.entity, self.direction, collation, self.nulls)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.sql(self.entity).literal(' %s' % self.direction)
 *         if self.collation:
 */

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

/* "sweepea.pyx":2353
 * 
 * 
 * def Asc(entity, collation=None, nulls=None):             # <<<<<<<<<<<<<<
 *     return Ordering(entity, 'ASC', collation, nulls)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_15Asc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_15Asc = {"Asc", (PyCFunction)__pyx_pw_7sweepea_15Asc, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_15Asc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_entity = 0;
  PyObject *__pyx_v_collation = 0;
  PyObject *__pyx_v_nulls = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Asc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_entity,&__pyx_n_s_collation,&__pyx_n_s_nulls,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_entity)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_collation);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nulls);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Asc") < 0)) __PYX_ERR(0, 2353, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_entity = values[0];
    __pyx_v_collation = values[1];
    __pyx_v_nulls = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Asc", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2353, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Asc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_14Asc(__pyx_self, __pyx_v_entity, __pyx_v_collation, __pyx_v_nulls);

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

static PyObject *__pyx_pf_7sweepea_14Asc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_entity, PyObject *__pyx_v_collation, PyObject *__pyx_v_nulls) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("Asc", 0);

  /* "sweepea.pyx":2354
 * 
 * def Asc(entity, collation=None, nulls=None):
 *     return Ordering(entity, 'ASC', collation, nulls)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Ordering); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_entity);
  __Pyx_GIVEREF(__pyx_v_entity);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_entity);
  __Pyx_INCREF(__pyx_n_s_ASC);
  __Pyx_GIVEREF(__pyx_n_s_ASC);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_ASC);
  __Pyx_INCREF(__pyx_v_collation);
  __Pyx_GIVEREF(__pyx_v_collation);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_collation);
  __Pyx_INCREF(__pyx_v_nulls);
  __Pyx_GIVEREF(__pyx_v_nulls);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_nulls);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2354, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2353
 * 
 * 
 * def Asc(entity, collation=None, nulls=None):             # <<<<<<<<<<<<<<
 *     return Ordering(entity, 'ASC', collation, nulls)
 * 
 */

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

/* "sweepea.pyx":2357
 * 
 * 
 * def Desc(entity, collation=None, nulls=None):             # <<<<<<<<<<<<<<
 *     return Ordering(entity, 'DESC', collation, nulls)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_17Desc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_17Desc = {"Desc", (PyCFunction)__pyx_pw_7sweepea_17Desc, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_17Desc(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_entity = 0;
  PyObject *__pyx_v_collation = 0;
  PyObject *__pyx_v_nulls = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Desc (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_entity,&__pyx_n_s_collation,&__pyx_n_s_nulls,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_entity)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_collation);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nulls);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "Desc") < 0)) __PYX_ERR(0, 2357, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_entity = values[0];
    __pyx_v_collation = values[1];
    __pyx_v_nulls = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("Desc", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2357, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Desc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_16Desc(__pyx_self, __pyx_v_entity, __pyx_v_collation, __pyx_v_nulls);

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

static PyObject *__pyx_pf_7sweepea_16Desc(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_entity, PyObject *__pyx_v_collation, PyObject *__pyx_v_nulls) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("Desc", 0);

  /* "sweepea.pyx":2358
 * 
 * def Desc(entity, collation=None, nulls=None):
 *     return Ordering(entity, 'DESC', collation, nulls)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Ordering); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_entity);
  __Pyx_GIVEREF(__pyx_v_entity);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_entity);
  __Pyx_INCREF(__pyx_n_s_DESC);
  __Pyx_GIVEREF(__pyx_n_s_DESC);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_DESC);
  __Pyx_INCREF(__pyx_v_collation);
  __Pyx_GIVEREF(__pyx_v_collation);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_collation);
  __Pyx_INCREF(__pyx_v_nulls);
  __Pyx_GIVEREF(__pyx_v_nulls);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_nulls);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2358, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2357
 * 
 * 
 * def Desc(entity, collation=None, nulls=None):             # <<<<<<<<<<<<<<
 *     return Ordering(entity, 'DESC', collation, nulls)
 * 
 */

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

/* "sweepea.pyx":2362
 * 
 * class Entity(EntityBase):
 *     def __init__(self, *path):             # <<<<<<<<<<<<<<
 *         self._path = filter(None, path)
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Entity_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Entity_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_6Entity_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Entity_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_path = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_path = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_path)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_path);
  } else {
    __pyx_v_path = __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, 2362, __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, 2362, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_path); __pyx_v_path = 0;
  __Pyx_AddTraceback("sweepea.Entity.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Entity___init__(__pyx_self, __pyx_v_self, __pyx_v_path);

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

/* "sweepea.pyx":2364
 *     def __init__(self, *path):
 *         self._path = filter(None, path)
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */

static PyObject *__pyx_pf_7sweepea_6Entity_8__init___genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr *)__pyx_tp_new_7sweepea___pyx_scope_struct_15_genexpr(__pyx_ptype_7sweepea___pyx_scope_struct_15_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__ *) __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_7sweepea_6Entity_8__init___2generator2, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Entity___init___locals_genexpr, __pyx_n_s_sweepea); if (unlikely(!gen)) __PYX_ERR(0, 2364, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("sweepea.Entity.__init__.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_7sweepea_6Entity_8__init___2generator2(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  __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, 2364, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2364, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2364, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2364, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2364, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2364, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2364, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        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, 2364, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_part);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_part, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_6, __pyx_cur_scope->__pyx_v_part); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2364, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __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_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2364, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __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;
}

/* "sweepea.pyx":2362
 * 
 * class Entity(EntityBase):
 *     def __init__(self, *path):             # <<<<<<<<<<<<<<
 *         self._path = filter(None, path)
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)
 */

static PyObject *__pyx_pf_7sweepea_6Entity___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__ *)__pyx_tp_new_7sweepea___pyx_scope_struct_14___init__(__pyx_ptype_7sweepea___pyx_scope_struct_14___init__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __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);

  /* "sweepea.pyx":2363
 * class Entity(EntityBase):
 *     def __init__(self, *path):
 *         self._path = filter(None, path)             # <<<<<<<<<<<<<<
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)
 * 
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_1, 0, Py_None);
  __Pyx_INCREF(__pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_path);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_filter, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_path, __pyx_t_2) < 0) __PYX_ERR(0, 2363, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2364
 *     def __init__(self, *path):
 *         self._path = filter(None, path)
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  __pyx_t_2 = __pyx_pf_7sweepea_6Entity_8__init___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyString_Join(__pyx_kp_s__64, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_quoted, __pyx_t_1) < 0) __PYX_ERR(0, 2364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2362
 * 
 * class Entity(EntityBase):
 *     def __init__(self, *path):             # <<<<<<<<<<<<<<
 *         self._path = filter(None, path)
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("sweepea.Entity.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2366
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return ctx.literal(self._quoted)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Entity_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Entity_3__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_6Entity_3__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Entity_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2366, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2366, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2366, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Entity.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2366, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Entity_2__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_6Entity_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2367
 * 
 *     def __sql__(self, Context ctx):
 *         return ctx.literal(self._quoted)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_quoted); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2367, __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;

  /* "sweepea.pyx":2366
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return ctx.literal(self._quoted)
 * 
 */

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

/* "sweepea.pyx":2371
 * 
 * class SQL(EntityBase):
 *     def __init__(self, sql, params=None):             # <<<<<<<<<<<<<<
 *         self.sql = sql
 *         self.params = params
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_3SQL_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_3SQL_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_3SQL_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_3SQL_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_sql = 0;
  PyObject *__pyx_v_params = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_sql,&__pyx_n_s_params,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((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  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_sql)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 2371, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_params);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2371, __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_sql = values[1];
    __pyx_v_params = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2371, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.SQL.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_3SQL___init__(__pyx_self, __pyx_v_self, __pyx_v_sql, __pyx_v_params);

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

static PyObject *__pyx_pf_7sweepea_3SQL___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_sql, PyObject *__pyx_v_params) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":2372
 * class SQL(EntityBase):
 *     def __init__(self, sql, params=None):
 *         self.sql = sql             # <<<<<<<<<<<<<<
 *         self.params = params
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sql, __pyx_v_sql) < 0) __PYX_ERR(0, 2372, __pyx_L1_error)

  /* "sweepea.pyx":2373
 *     def __init__(self, sql, params=None):
 *         self.sql = sql
 *         self.params = params             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_params, __pyx_v_params) < 0) __PYX_ERR(0, 2373, __pyx_L1_error)

  /* "sweepea.pyx":2371
 * 
 * class SQL(EntityBase):
 *     def __init__(self, sql, params=None):             # <<<<<<<<<<<<<<
 *         self.sql = sql
 *         self.params = params
 */

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

/* "sweepea.pyx":2375
 *         self.params = params
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.literal(self.sql)
 *         if self.params:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_3SQL_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_3SQL_3__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_3SQL_3__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_3SQL_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2375, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2375, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2375, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.SQL.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2375, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_3SQL_2__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_3SQL_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_v_param = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2376
 * 
 *     def __sql__(self, Context ctx):
 *         ctx.literal(self.sql)             # <<<<<<<<<<<<<<
 *         if self.params:
 *             for param in self.params:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sql); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2377
 *     def __sql__(self, Context ctx):
 *         ctx.literal(self.sql)
 *         if self.params:             # <<<<<<<<<<<<<<
 *             for param in self.params:
 *                 if isinstance(param, Node):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2377, __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, 2377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

    /* "sweepea.pyx":2378
 *         ctx.literal(self.sql)
 *         if self.params:
 *             for param in self.params:             # <<<<<<<<<<<<<<
 *                 if isinstance(param, Node):
 *                     ctx.sql(param)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_params); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    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_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2378, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2378, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2378, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2378, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2378, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2378, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_5(__pyx_t_1);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 2378, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_param, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "sweepea.pyx":2379
 *         if self.params:
 *             for param in self.params:
 *                 if isinstance(param, Node):             # <<<<<<<<<<<<<<
 *                     ctx.sql(param)
 *                 else:
 */
      __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2379, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_IsInstance(__pyx_v_param, __pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2379, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_6 = (__pyx_t_3 != 0);
      if (__pyx_t_6) {

        /* "sweepea.pyx":2380
 *             for param in self.params:
 *                 if isinstance(param, Node):
 *                     ctx.sql(param)             # <<<<<<<<<<<<<<
 *                 else:
 *                     ctx.bind_value(param)
 */
        __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_v_param, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2380, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

        /* "sweepea.pyx":2379
 *         if self.params:
 *             for param in self.params:
 *                 if isinstance(param, Node):             # <<<<<<<<<<<<<<
 *                     ctx.sql(param)
 *                 else:
 */
        goto __pyx_L6;
      }

      /* "sweepea.pyx":2382
 *                     ctx.sql(param)
 *                 else:
 *                     ctx.bind_value(param)             # <<<<<<<<<<<<<<
 *         return ctx
 * 
 */
      /*else*/ {
        __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->bind_value(__pyx_v_ctx, __pyx_v_param)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2382, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __pyx_L6:;

      /* "sweepea.pyx":2378
 *         ctx.literal(self.sql)
 *         if self.params:
 *             for param in self.params:             # <<<<<<<<<<<<<<
 *                 if isinstance(param, Node):
 *                     ctx.sql(param)
 */
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "sweepea.pyx":2377
 *     def __sql__(self, Context ctx):
 *         ctx.literal(self.sql)
 *         if self.params:             # <<<<<<<<<<<<<<
 *             for param in self.params:
 *                 if isinstance(param, Node):
 */
  }

  /* "sweepea.pyx":2383
 *                 else:
 *                     ctx.bind_value(param)
 *         return ctx             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
  __pyx_r = ((PyObject *)__pyx_v_ctx);
  goto __pyx_L0;

  /* "sweepea.pyx":2375
 *         self.params = params
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.literal(self.sql)
 *         if self.params:
 */

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

/* "sweepea.pyx":2386
 * 
 * 
 * def Check(constraint):             # <<<<<<<<<<<<<<
 *     return SQL('CHECK (%s)' % constraint)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_19Check(PyObject *__pyx_self, PyObject *__pyx_v_constraint); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_19Check = {"Check", (PyCFunction)__pyx_pw_7sweepea_19Check, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_19Check(PyObject *__pyx_self, PyObject *__pyx_v_constraint) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("Check (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_18Check(__pyx_self, ((PyObject *)__pyx_v_constraint));

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

static PyObject *__pyx_pf_7sweepea_18Check(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_constraint) {
  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;
  __Pyx_RefNannySetupContext("Check", 0);

  /* "sweepea.pyx":2387
 * 
 * def Check(constraint):
 *     return SQL('CHECK (%s)' % constraint)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SQL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_CHECK_s, __pyx_v_constraint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2387, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2387, __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_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2387, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2386
 * 
 * 
 * def Check(constraint):             # <<<<<<<<<<<<<<
 *     return SQL('CHECK (%s)' % constraint)
 * 
 */

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

/* "sweepea.pyx":2391
 * 
 * class Function(EntityBase):
 *     def __init__(self, name, arguments):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arguments = arguments
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Function_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_8Function_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_8Function_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_8Function_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_arguments = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_arguments,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_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 2391, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arguments)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 2391, __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, 2391, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_arguments = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2391, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Function.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Function___init__(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_arguments);

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

static PyObject *__pyx_pf_7sweepea_8Function___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_arguments) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":2392
 * class Function(EntityBase):
 *     def __init__(self, name, arguments):
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arguments = arguments
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_name, __pyx_v_name) < 0) __PYX_ERR(0, 2392, __pyx_L1_error)

  /* "sweepea.pyx":2393
 *     def __init__(self, name, arguments):
 *         self.name = name
 *         self.arguments = arguments             # <<<<<<<<<<<<<<
 * 
 *     def __getattr__(self, attr):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_arguments, __pyx_v_arguments) < 0) __PYX_ERR(0, 2393, __pyx_L1_error)

  /* "sweepea.pyx":2391
 * 
 * class Function(EntityBase):
 *     def __init__(self, name, arguments):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arguments = arguments
 */

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

/* "sweepea.pyx":2395
 *         self.arguments = arguments
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         def decorator(*args):
 *             return Function(attr, args)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Function_3__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_8Function_3__getattr__ = {"__getattr__", (PyCFunction)__pyx_pw_7sweepea_8Function_3__getattr__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_8Function_3__getattr__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_attr = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_attr,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_attr)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, 1); __PYX_ERR(0, 2395, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getattr__") < 0)) __PYX_ERR(0, 2395, __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_attr = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getattr__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2395, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Function.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_8Function_2__getattr__(__pyx_self, __pyx_v_self, __pyx_v_attr);

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

/* "sweepea.pyx":2396
 * 
 *     def __getattr__(self, attr):
 *         def decorator(*args):             # <<<<<<<<<<<<<<
 *             return Function(attr, args)
 *         return decorator
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Function_11__getattr___1decorator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_8Function_11__getattr___1decorator = {"decorator", (PyCFunction)__pyx_pw_7sweepea_8Function_11__getattr___1decorator, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_8Function_11__getattr___1decorator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("decorator (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "decorator", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_7sweepea_8Function_11__getattr___decorator(__pyx_self, __pyx_v_args);

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

static PyObject *__pyx_pf_7sweepea_8Function_11__getattr___decorator(PyObject *__pyx_self, PyObject *__pyx_v_args) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__ *__pyx_cur_scope;
  struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__ *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("decorator", 0);
  __pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__ *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "sweepea.pyx":2397
 *     def __getattr__(self, attr):
 *         def decorator(*args):
 *             return Function(attr, args)             # <<<<<<<<<<<<<<
 *         return decorator
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Function); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_v_attr)) { __Pyx_RaiseClosureNameError("attr"); __PYX_ERR(0, 2397, __pyx_L1_error) }
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_attr);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_attr);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_cur_scope->__pyx_v_attr);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_args);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2397, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2396
 * 
 *     def __getattr__(self, attr):
 *         def decorator(*args):             # <<<<<<<<<<<<<<
 *             return Function(attr, args)
 *         return decorator
 */

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

/* "sweepea.pyx":2395
 *         self.arguments = arguments
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         def decorator(*args):
 *             return Function(attr, args)
 */

static PyObject *__pyx_pf_7sweepea_8Function_2__getattr__(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__ *__pyx_cur_scope;
  PyObject *__pyx_v_decorator = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__getattr__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__ *)__pyx_tp_new_7sweepea___pyx_scope_struct_16___getattr__(__pyx_ptype_7sweepea___pyx_scope_struct_16___getattr__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_attr = __pyx_v_attr;
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_attr);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_attr);

  /* "sweepea.pyx":2396
 * 
 *     def __getattr__(self, attr):
 *         def decorator(*args):             # <<<<<<<<<<<<<<
 *             return Function(attr, args)
 *         return decorator
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_8Function_11__getattr___1decorator, 0, __pyx_n_s_Function___getattr___locals_deco, ((PyObject*)__pyx_cur_scope), __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__70)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_decorator = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":2398
 *         def decorator(*args):
 *             return Function(attr, args)
 *         return decorator             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_decorator);
  __pyx_r = __pyx_v_decorator;
  goto __pyx_L0;

  /* "sweepea.pyx":2395
 *         self.arguments = arguments
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         def decorator(*args):
 *             return Function(attr, args)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("sweepea.Function.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_decorator);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2400
 *         return decorator
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.literal(self.name)
 *         if not len(self.arguments):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_8Function_5__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_8Function_5__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_8Function_5__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_8Function_5__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2400, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2400, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2400, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Function.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2400, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_8Function_4__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_8Function_4__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_v_arg = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2401
 * 
 *     def __sql__(self, Context ctx):
 *         ctx.literal(self.name)             # <<<<<<<<<<<<<<
 *         if not len(self.arguments):
 *             ctx.literal('()')
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2402
 *     def __sql__(self, Context ctx):
 *         ctx.literal(self.name)
 *         if not len(self.arguments):             # <<<<<<<<<<<<<<
 *             ctx.literal('()')
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arguments); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2402, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Length(__pyx_t_2); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(0, 2402, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = ((!(__pyx_t_3 != 0)) != 0);
  if (__pyx_t_4) {

    /* "sweepea.pyx":2403
 *         ctx.literal(self.name)
 *         if not len(self.arguments):
 *             ctx.literal('()')             # <<<<<<<<<<<<<<
 *         else:
 *             ctx.sql(EnclosedList([
 */
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s__71, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":2402
 *     def __sql__(self, Context ctx):
 *         ctx.literal(self.name)
 *         if not len(self.arguments):             # <<<<<<<<<<<<<<
 *             ctx.literal('()')
 *         else:
 */
    goto __pyx_L3;
  }

  /* "sweepea.pyx":2405
 *             ctx.literal('()')
 *         else:
 *             ctx.sql(EnclosedList([             # <<<<<<<<<<<<<<
 *                 (arg if isinstance(arg, Node) else Value(arg))
 *                 for arg in self.arguments]))
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EnclosedList); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);

    /* "sweepea.pyx":2407
 *             ctx.sql(EnclosedList([
 *                 (arg if isinstance(arg, Node) else Value(arg))
 *                 for arg in self.arguments]))             # <<<<<<<<<<<<<<
 *         return ctx
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arguments); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_7 = __pyx_t_6; __Pyx_INCREF(__pyx_t_7); __pyx_t_3 = 0;
      __pyx_t_8 = NULL;
    } else {
      __pyx_t_3 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2407, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2407, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_8)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2407, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2407, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_3); __Pyx_INCREF(__pyx_t_6); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2407, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_7, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2407, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_8(__pyx_t_7);
        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, 2407, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_arg, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "sweepea.pyx":2406
 *         else:
 *             ctx.sql(EnclosedList([
 *                 (arg if isinstance(arg, Node) else Value(arg))             # <<<<<<<<<<<<<<
 *                 for arg in self.arguments]))
 *         return ctx
 */
      __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2406, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_4 = PyObject_IsInstance(__pyx_v_arg, __pyx_t_9); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2406, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if ((__pyx_t_4 != 0)) {
        __Pyx_INCREF(__pyx_v_arg);
        __pyx_t_6 = __pyx_v_arg;
      } else {
        __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_Value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2406, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_11 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
          }
        }
        if (!__pyx_t_11) {
          __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_arg); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2406, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
        } else {
          __pyx_t_12 = PyTuple_New(1+1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2406, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
          __Pyx_INCREF(__pyx_v_arg);
          __Pyx_GIVEREF(__pyx_v_arg);
          PyTuple_SET_ITEM(__pyx_t_12, 0+1, __pyx_v_arg);
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2406, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        }
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_6 = __pyx_t_9;
        __pyx_t_9 = 0;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 2405, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

      /* "sweepea.pyx":2407
 *             ctx.sql(EnclosedList([
 *                 (arg if isinstance(arg, Node) else Value(arg))
 *                 for arg in self.arguments]))             # <<<<<<<<<<<<<<
 *         return ctx
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2405, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __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, 2405, __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;

    /* "sweepea.pyx":2405
 *             ctx.literal('()')
 *         else:
 *             ctx.sql(EnclosedList([             # <<<<<<<<<<<<<<
 *                 (arg if isinstance(arg, Node) else Value(arg))
 *                 for arg in self.arguments]))
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_2, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2405, __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;
  }
  __pyx_L3:;

  /* "sweepea.pyx":2408
 *                 (arg if isinstance(arg, Node) else Value(arg))
 *                 for arg in self.arguments]))
 *         return ctx             # <<<<<<<<<<<<<<
 * 
 * fn = Function(None, None)
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
  __pyx_r = ((PyObject *)__pyx_v_ctx);
  goto __pyx_L0;

  /* "sweepea.pyx":2400
 *         return decorator
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.literal(self.name)
 *         if not len(self.arguments):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("sweepea.Function.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_arg);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2414
 * 
 * class List(Node):
 *     def __init__(self, nodes, glue=' ', parentheses=False):             # <<<<<<<<<<<<<<
 *         self.nodes = nodes
 *         self.glue = glue
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_4List_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_4List_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_4List_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_4List_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_nodes = 0;
  PyObject *__pyx_v_glue = 0;
  PyObject *__pyx_v_parentheses = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_nodes,&__pyx_n_s_glue,&__pyx_n_s_parentheses,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_kp_s__57));
    values[3] = ((PyObject *)((PyObject *)Py_False));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  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_nodes)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 2414, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_glue);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parentheses);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2414, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_nodes = values[1];
    __pyx_v_glue = values[2];
    __pyx_v_parentheses = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2414, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.List.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_4List___init__(__pyx_self, __pyx_v_self, __pyx_v_nodes, __pyx_v_glue, __pyx_v_parentheses);

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

static PyObject *__pyx_pf_7sweepea_4List___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_nodes, PyObject *__pyx_v_glue, PyObject *__pyx_v_parentheses) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":2415
 * class List(Node):
 *     def __init__(self, nodes, glue=' ', parentheses=False):
 *         self.nodes = nodes             # <<<<<<<<<<<<<<
 *         self.glue = glue
 *         self.parentheses = parentheses
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_nodes, __pyx_v_nodes) < 0) __PYX_ERR(0, 2415, __pyx_L1_error)

  /* "sweepea.pyx":2416
 *     def __init__(self, nodes, glue=' ', parentheses=False):
 *         self.nodes = nodes
 *         self.glue = glue             # <<<<<<<<<<<<<<
 *         self.parentheses = parentheses
 *         # Hack to avoid double-parentheses.
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_glue, __pyx_v_glue) < 0) __PYX_ERR(0, 2416, __pyx_L1_error)

  /* "sweepea.pyx":2417
 *         self.nodes = nodes
 *         self.glue = glue
 *         self.parentheses = parentheses             # <<<<<<<<<<<<<<
 *         # Hack to avoid double-parentheses.
 *         if parentheses and len(self.nodes) == 1:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_parentheses, __pyx_v_parentheses) < 0) __PYX_ERR(0, 2417, __pyx_L1_error)

  /* "sweepea.pyx":2419
 *         self.parentheses = parentheses
 *         # Hack to avoid double-parentheses.
 *         if parentheses and len(self.nodes) == 1:             # <<<<<<<<<<<<<<
 *             if isinstance(self.nodes[0], Expression):
 *                 self.nodes[0].flat = True
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_parentheses); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2419, __pyx_L1_error)
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2419, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = ((__pyx_t_4 == 1) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "sweepea.pyx":2420
 *         # Hack to avoid double-parentheses.
 *         if parentheses and len(self.nodes) == 1:
 *             if isinstance(self.nodes[0], Expression):             # <<<<<<<<<<<<<<
 *                 self.nodes[0].flat = True
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Expression); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = PyObject_IsInstance(__pyx_t_5, __pyx_t_3); if (unlikely(__pyx_t_1 == -1)) __PYX_ERR(0, 2420, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "sweepea.pyx":2421
 *         if parentheses and len(self.nodes) == 1:
 *             if isinstance(self.nodes[0], Expression):
 *                 self.nodes[0].flat = True             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2421, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__Pyx_PyObject_SetAttrStr(__pyx_t_5, __pyx_n_s_flat, Py_True) < 0) __PYX_ERR(0, 2421, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "sweepea.pyx":2420
 *         # Hack to avoid double-parentheses.
 *         if parentheses and len(self.nodes) == 1:
 *             if isinstance(self.nodes[0], Expression):             # <<<<<<<<<<<<<<
 *                 self.nodes[0].flat = True
 * 
 */
    }

    /* "sweepea.pyx":2419
 *         self.parentheses = parentheses
 *         # Hack to avoid double-parentheses.
 *         if parentheses and len(self.nodes) == 1:             # <<<<<<<<<<<<<<
 *             if isinstance(self.nodes[0], Expression):
 *                 self.nodes[0].flat = True
 */
  }

  /* "sweepea.pyx":2414
 * 
 * class List(Node):
 *     def __init__(self, nodes, glue=' ', parentheses=False):             # <<<<<<<<<<<<<<
 *         self.nodes = nodes
 *         self.glue = glue
 */

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

/* "sweepea.pyx":2423
 *                 self.nodes[0].flat = True
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         n = len(self.nodes)
 *         if n == 0:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_4List_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_4List_3__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_4List_3__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_4List_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2423, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2423, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2423, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.List.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2423, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_4List_2__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_4List_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2424
 * 
 *     def __sql__(self, Context ctx):
 *         n = len(self.nodes)             # <<<<<<<<<<<<<<
 *         if n == 0:
 *             return ctx
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == -1)) __PYX_ERR(0, 2424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_n = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":2425
 *     def __sql__(self, Context ctx):
 *         n = len(self.nodes)
 *         if n == 0:             # <<<<<<<<<<<<<<
 *             return ctx
 *         with ctx(parentheses=self.parentheses):
 */
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_v_n, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2425, __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, 2425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_3) {

    /* "sweepea.pyx":2426
 *         n = len(self.nodes)
 *         if n == 0:
 *             return ctx             # <<<<<<<<<<<<<<
 *         with ctx(parentheses=self.parentheses):
 *             for i in range(n - 1):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
    __pyx_r = ((PyObject *)__pyx_v_ctx);
    goto __pyx_L0;

    /* "sweepea.pyx":2425
 *     def __sql__(self, Context ctx):
 *         n = len(self.nodes)
 *         if n == 0:             # <<<<<<<<<<<<<<
 *             return ctx
 *         with ctx(parentheses=self.parentheses):
 */
  }

  /* "sweepea.pyx":2427
 *         if n == 0:
 *             return ctx
 *         with ctx(parentheses=self.parentheses):             # <<<<<<<<<<<<<<
 *             for i in range(n - 1):
 *                 ctx.sql(self.nodes[i])
 */
  /*with:*/ {
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_parentheses); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_parentheses, __pyx_t_4) < 0) __PYX_ERR(0, 2427, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_ctx), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2427, __pyx_L4_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    if (__pyx_t_7) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2427, __pyx_L4_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2427, __pyx_L4_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_10);
        /*try:*/ {

          /* "sweepea.pyx":2428
 *             return ctx
 *         with ctx(parentheses=self.parentheses):
 *             for i in range(n - 1):             # <<<<<<<<<<<<<<
 *                 ctx.sql(self.nodes[i])
 *                 ctx.literal(self.glue)
 */
          __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2428, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2428, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
          __pyx_t_4 = 0;
          __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2428, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
            __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
            __pyx_t_11 = NULL;
          } else {
            __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2428, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_11 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2428, __pyx_L8_error)
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          for (;;) {
            if (likely(!__pyx_t_11)) {
              if (likely(PyList_CheckExact(__pyx_t_1))) {
                if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __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, 2428, __pyx_L8_error)
                #else
                __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2428, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_4);
                #endif
              } else {
                if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __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, 2428, __pyx_L8_error)
                #else
                __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2428, __pyx_L8_error)
                __Pyx_GOTREF(__pyx_t_4);
                #endif
              }
            } else {
              __pyx_t_4 = __pyx_t_11(__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, 2428, __pyx_L8_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_4);
            }
            __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
            __pyx_t_4 = 0;

            /* "sweepea.pyx":2429
 *         with ctx(parentheses=self.parentheses):
 *             for i in range(n - 1):
 *                 ctx.sql(self.nodes[i])             # <<<<<<<<<<<<<<
 *                 ctx.literal(self.glue)
 *             ctx.sql(self.nodes[n - 1])
 */
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2429, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_6 = PyObject_GetItem(__pyx_t_4, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2429, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_6, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2429, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "sweepea.pyx":2430
 *             for i in range(n - 1):
 *                 ctx.sql(self.nodes[i])
 *                 ctx.literal(self.glue)             # <<<<<<<<<<<<<<
 *             ctx.sql(self.nodes[n - 1])
 *         return ctx
 */
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_glue); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2430, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_t_4, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2430, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_6);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

            /* "sweepea.pyx":2428
 *             return ctx
 *         with ctx(parentheses=self.parentheses):
 *             for i in range(n - 1):             # <<<<<<<<<<<<<<
 *                 ctx.sql(self.nodes[i])
 *                 ctx.literal(self.glue)
 */
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "sweepea.pyx":2431
 *                 ctx.sql(self.nodes[i])
 *                 ctx.literal(self.glue)
 *             ctx.sql(self.nodes[n - 1])             # <<<<<<<<<<<<<<
 *         return ctx
 * 
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2431, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_6 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2431, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_6);
          __pyx_t_4 = PyObject_GetItem(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2431, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __pyx_t_6 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_4, 0)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2431, __pyx_L8_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

          /* "sweepea.pyx":2427
 *         if n == 0:
 *             return ctx
 *         with ctx(parentheses=self.parentheses):             # <<<<<<<<<<<<<<
 *             for i in range(n - 1):
 *                 ctx.sql(self.nodes[i])
 */
        }
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        goto __pyx_L15_try_end;
        __pyx_L8_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("sweepea.List.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 2427, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_6);
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_7 = PyTuple_Pack(3, __pyx_t_6, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2427, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2427, __pyx_L10_except_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (__pyx_t_3 < 0) __PYX_ERR(0, 2427, __pyx_L10_except_error)
          __pyx_t_13 = ((!(__pyx_t_3 != 0)) != 0);
          if (__pyx_t_13) {
            __Pyx_GIVEREF(__pyx_t_6);
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_XGIVEREF(__pyx_t_1);
            __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_4, __pyx_t_1);
            __pyx_t_6 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0; 
            __PYX_ERR(0, 2427, __pyx_L10_except_error)
          }
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L9_exception_handled;
        }
        __pyx_L10_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        goto __pyx_L1_error;
        __pyx_L9_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
        __pyx_L15_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_5) {
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__72, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2427, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        goto __pyx_L7;
      }
      __pyx_L7:;
    }
    goto __pyx_L21;
    __pyx_L4_error:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L1_error;
    __pyx_L21:;
  }

  /* "sweepea.pyx":2432
 *                 ctx.literal(self.glue)
 *             ctx.sql(self.nodes[n - 1])
 *         return ctx             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
  __pyx_r = ((PyObject *)__pyx_v_ctx);
  goto __pyx_L0;

  /* "sweepea.pyx":2423
 *                 self.nodes[0].flat = True
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         n = len(self.nodes)
 *         if n == 0:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("sweepea.List.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2435
 * 
 * 
 * def CommaList(nodes):             # <<<<<<<<<<<<<<
 *     return List(nodes, ', ')
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_21CommaList(PyObject *__pyx_self, PyObject *__pyx_v_nodes); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_21CommaList = {"CommaList", (PyCFunction)__pyx_pw_7sweepea_21CommaList, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_21CommaList(PyObject *__pyx_self, PyObject *__pyx_v_nodes) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("CommaList (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_20CommaList(__pyx_self, ((PyObject *)__pyx_v_nodes));

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

static PyObject *__pyx_pf_7sweepea_20CommaList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_nodes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("CommaList", 0);

  /* "sweepea.pyx":2436
 * 
 * def CommaList(nodes):
 *     return List(nodes, ', ')             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_List); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_nodes);
  __Pyx_GIVEREF(__pyx_v_nodes);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_nodes);
  __Pyx_INCREF(__pyx_kp_s__5);
  __Pyx_GIVEREF(__pyx_kp_s__5);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_kp_s__5);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2436, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2435
 * 
 * 
 * def CommaList(nodes):             # <<<<<<<<<<<<<<
 *     return List(nodes, ', ')
 * 
 */

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

/* "sweepea.pyx":2439
 * 
 * 
 * def EnclosedList(nodes):             # <<<<<<<<<<<<<<
 *     return List(nodes, ', ', True)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_23EnclosedList(PyObject *__pyx_self, PyObject *__pyx_v_nodes); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_23EnclosedList = {"EnclosedList", (PyCFunction)__pyx_pw_7sweepea_23EnclosedList, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_23EnclosedList(PyObject *__pyx_self, PyObject *__pyx_v_nodes) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("EnclosedList (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_22EnclosedList(__pyx_self, ((PyObject *)__pyx_v_nodes));

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

static PyObject *__pyx_pf_7sweepea_22EnclosedList(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_nodes) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("EnclosedList", 0);

  /* "sweepea.pyx":2440
 * 
 * def EnclosedList(nodes):
 *     return List(nodes, ', ', True)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_List); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2440, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_nodes);
  __Pyx_GIVEREF(__pyx_v_nodes);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_nodes);
  __Pyx_INCREF(__pyx_kp_s__5);
  __Pyx_GIVEREF(__pyx_kp_s__5);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_kp_s__5);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, Py_True);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2440, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2439
 * 
 * 
 * def EnclosedList(nodes):             # <<<<<<<<<<<<<<
 *     return List(nodes, ', ', True)
 * 
 */

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

/* "sweepea.pyx":2446
 *     commit = True
 * 
 *     def __init__(self, order_by=None, limit=None, offset=None, **kwargs):             # <<<<<<<<<<<<<<
 *         super(Query, self).__init__(**kwargs)
 *         self._order_by, self._limit, self._offset = order_by, limit, offset
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Query_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Query_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_5Query_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Query_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_order_by = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_order_by,&__pyx_n_s_limit,&__pyx_n_s_offset,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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 (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_order_by);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2446, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_order_by = values[1];
    __pyx_v_limit = values[2];
    __pyx_v_offset = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2446, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("sweepea.Query.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Query___init__(__pyx_self, __pyx_v_self, __pyx_v_order_by, __pyx_v_limit, __pyx_v_offset, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7sweepea_5Query___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_order_by, PyObject *__pyx_v_limit, PyObject *__pyx_v_offset, PyObject *__pyx_v_kwargs) {
  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);

  /* "sweepea.pyx":2447
 * 
 *     def __init__(self, order_by=None, limit=None, offset=None, **kwargs):
 *         super(Query, self).__init__(**kwargs)             # <<<<<<<<<<<<<<
 *         self._order_by, self._limit, self._offset = order_by, limit, offset
 *         self._cte_list = None
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2447, __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_empty_tuple, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2447, __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;

  /* "sweepea.pyx":2448
 *     def __init__(self, order_by=None, limit=None, offset=None, **kwargs):
 *         super(Query, self).__init__(**kwargs)
 *         self._order_by, self._limit, self._offset = order_by, limit, offset             # <<<<<<<<<<<<<<
 *         self._cte_list = None
 *         self._cursor = None
 */
  __pyx_t_1 = __pyx_v_order_by;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = __pyx_v_limit;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_3 = __pyx_v_offset;
  __Pyx_INCREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_order_by_2, __pyx_t_1) < 0) __PYX_ERR(0, 2448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_limit_2, __pyx_t_2) < 0) __PYX_ERR(0, 2448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset_2, __pyx_t_3) < 0) __PYX_ERR(0, 2448, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "sweepea.pyx":2449
 *         super(Query, self).__init__(**kwargs)
 *         self._order_by, self._limit, self._offset = order_by, limit, offset
 *         self._cte_list = None             # <<<<<<<<<<<<<<
 *         self._cursor = None
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cte_list, Py_None) < 0) __PYX_ERR(0, 2449, __pyx_L1_error)

  /* "sweepea.pyx":2450
 *         self._order_by, self._limit, self._offset = order_by, limit, offset
 *         self._cte_list = None
 *         self._cursor = None             # <<<<<<<<<<<<<<
 * 
 *     def clone(self):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cursor_2, Py_None) < 0) __PYX_ERR(0, 2450, __pyx_L1_error)

  /* "sweepea.pyx":2446
 *     commit = True
 * 
 *     def __init__(self, order_by=None, limit=None, offset=None, **kwargs):             # <<<<<<<<<<<<<<
 *         super(Query, self).__init__(**kwargs)
 *         self._order_by, self._limit, self._offset = order_by, limit, offset
 */

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

/* "sweepea.pyx":2452
 *         self._cursor = None
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         query = super(Query, self).clone()
 *         query._cursor = None
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Query_3clone(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Query_3clone = {"clone", (PyCFunction)__pyx_pw_7sweepea_5Query_3clone, METH_O, 0};
static PyObject *__pyx_pw_7sweepea_5Query_3clone(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clone (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_5Query_2clone(__pyx_self, ((PyObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_7sweepea_5Query_2clone(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_query = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("clone", 0);

  /* "sweepea.pyx":2453
 * 
 *     def clone(self):
 *         query = super(Query, self).clone()             # <<<<<<<<<<<<<<
 *         query._cursor = None
 *         return query
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Query); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_clone); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2453, __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, 2453, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_query = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":2454
 *     def clone(self):
 *         query = super(Query, self).clone()
 *         query._cursor = None             # <<<<<<<<<<<<<<
 *         return query
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_query, __pyx_n_s_cursor_2, Py_None) < 0) __PYX_ERR(0, 2454, __pyx_L1_error)

  /* "sweepea.pyx":2455
 *         query = super(Query, self).clone()
 *         query._cursor = None
 *         return query             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_query);
  __pyx_r = __pyx_v_query;
  goto __pyx_L0;

  /* "sweepea.pyx":2452
 *         self._cursor = None
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         query = super(Query, self).clone()
 *         query._cursor = None
 */

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

/* "sweepea.pyx":2458
 * 
 *     @Node.copy
 *     def with_(self, *cte_list):             # <<<<<<<<<<<<<<
 *         self._cte_list = cte_list
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Query_5with_(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Query_5with_ = {"with_", (PyCFunction)__pyx_pw_7sweepea_5Query_5with_, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Query_5with_(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_cte_list = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("with_ (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_cte_list = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_cte_list)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_cte_list);
  } else {
    __pyx_v_cte_list = __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, "with_") < 0)) __PYX_ERR(0, 2458, __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("with_", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2458, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_cte_list); __pyx_v_cte_list = 0;
  __Pyx_AddTraceback("sweepea.Query.with_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Query_4with_(__pyx_self, __pyx_v_self, __pyx_v_cte_list);

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

static PyObject *__pyx_pf_7sweepea_5Query_4with_(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_cte_list) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("with_", 0);

  /* "sweepea.pyx":2459
 *     @Node.copy
 *     def with_(self, *cte_list):
 *         self._cte_list = cte_list             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cte_list, __pyx_v_cte_list) < 0) __PYX_ERR(0, 2459, __pyx_L1_error)

  /* "sweepea.pyx":2458
 * 
 *     @Node.copy
 *     def with_(self, *cte_list):             # <<<<<<<<<<<<<<
 *         self._cte_list = cte_list
 * 
 */

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

/* "sweepea.pyx":2462
 * 
 *     @Node.copy
 *     def order_by(self, *values):             # <<<<<<<<<<<<<<
 *         self._order_by = values
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Query_7order_by(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Query_7order_by = {"order_by", (PyCFunction)__pyx_pw_7sweepea_5Query_7order_by, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Query_7order_by(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("order_by (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, "order_by") < 0)) __PYX_ERR(0, 2462, __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("order_by", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2462, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_values); __pyx_v_values = 0;
  __Pyx_AddTraceback("sweepea.Query.order_by", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Query_6order_by(__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_7sweepea_5Query_6order_by(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("order_by", 0);

  /* "sweepea.pyx":2463
 *     @Node.copy
 *     def order_by(self, *values):
 *         self._order_by = values             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_order_by_2, __pyx_v_values) < 0) __PYX_ERR(0, 2463, __pyx_L1_error)

  /* "sweepea.pyx":2462
 * 
 *     @Node.copy
 *     def order_by(self, *values):             # <<<<<<<<<<<<<<
 *         self._order_by = values
 * 
 */

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

/* "sweepea.pyx":2466
 * 
 *     @Node.copy
 *     def order_by_extend(self, *values):             # <<<<<<<<<<<<<<
 *         self._order_by = ((self._order_by or ()) + values) or None
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Query_9order_by_extend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Query_9order_by_extend = {"order_by_extend", (PyCFunction)__pyx_pw_7sweepea_5Query_9order_by_extend, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Query_9order_by_extend(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("order_by_extend (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, "order_by_extend") < 0)) __PYX_ERR(0, 2466, __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("order_by_extend", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2466, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_values); __pyx_v_values = 0;
  __Pyx_AddTraceback("sweepea.Query.order_by_extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Query_8order_by_extend(__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_7sweepea_5Query_8order_by_extend(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_values) {
  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;
  __Pyx_RefNannySetupContext("order_by_extend", 0);

  /* "sweepea.pyx":2467
 *     @Node.copy
 *     def order_by_extend(self, *values):
 *         self._order_by = ((self._order_by or ()) + values) or None             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_order_by_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2467, __pyx_L1_error)
  if (!__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_t_2 = __pyx_empty_tuple;
  __pyx_L5_bool_binop_done:;
  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2467, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2467, __pyx_L1_error)
  if (!__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(Py_None);
  __pyx_t_1 = Py_None;
  __pyx_L3_bool_binop_done:;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_order_by_2, __pyx_t_1) < 0) __PYX_ERR(0, 2467, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2466
 * 
 *     @Node.copy
 *     def order_by_extend(self, *values):             # <<<<<<<<<<<<<<
 *         self._order_by = ((self._order_by or ()) + values) or 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_AddTraceback("sweepea.Query.order_by_extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2470
 * 
 *     @Node.copy
 *     def limit(self, limit=None):             # <<<<<<<<<<<<<<
 *         self._limit = limit
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Query_11limit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Query_11limit = {"limit", (PyCFunction)__pyx_pw_7sweepea_5Query_11limit, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Query_11limit(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("limit (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_limit,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_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_limit);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "limit") < 0)) __PYX_ERR(0, 2470, __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_limit = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("limit", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2470, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Query.limit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Query_10limit(__pyx_self, __pyx_v_self, __pyx_v_limit);

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

static PyObject *__pyx_pf_7sweepea_5Query_10limit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_limit) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("limit", 0);

  /* "sweepea.pyx":2471
 *     @Node.copy
 *     def limit(self, limit=None):
 *         self._limit = limit             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_limit_2, __pyx_v_limit) < 0) __PYX_ERR(0, 2471, __pyx_L1_error)

  /* "sweepea.pyx":2470
 * 
 *     @Node.copy
 *     def limit(self, limit=None):             # <<<<<<<<<<<<<<
 *         self._limit = limit
 * 
 */

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

/* "sweepea.pyx":2474
 * 
 *     @Node.copy
 *     def offset(self, offset=None):             # <<<<<<<<<<<<<<
 *         self._offset = offset
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Query_13offset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Query_13offset = {"offset", (PyCFunction)__pyx_pw_7sweepea_5Query_13offset, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Query_13offset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("offset (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_offset,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_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_offset);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "offset") < 0)) __PYX_ERR(0, 2474, __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_offset = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("offset", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2474, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Query.offset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Query_12offset(__pyx_self, __pyx_v_self, __pyx_v_offset);

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

static PyObject *__pyx_pf_7sweepea_5Query_12offset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_offset) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("offset", 0);

  /* "sweepea.pyx":2475
 *     @Node.copy
 *     def offset(self, offset=None):
 *         self._offset = offset             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset_2, __pyx_v_offset) < 0) __PYX_ERR(0, 2475, __pyx_L1_error)

  /* "sweepea.pyx":2474
 * 
 *     @Node.copy
 *     def offset(self, offset=None):             # <<<<<<<<<<<<<<
 *         self._offset = offset
 * 
 */

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

/* "sweepea.pyx":2478
 * 
 *     @Node.copy
 *     def paginate(self, page, n=20):             # <<<<<<<<<<<<<<
 *         if page > 0:
 *             page -= 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Query_15paginate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Query_15paginate = {"paginate", (PyCFunction)__pyx_pw_7sweepea_5Query_15paginate, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Query_15paginate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_page = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("paginate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_page,&__pyx_n_s_n,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)((PyObject *)__pyx_int_20));
    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_page)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("paginate", 0, 2, 3, 1); __PYX_ERR(0, 2478, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "paginate") < 0)) __PYX_ERR(0, 2478, __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_page = values[1];
    __pyx_v_n = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("paginate", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2478, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Query.paginate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Query_14paginate(__pyx_self, __pyx_v_self, __pyx_v_page, __pyx_v_n);

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

static PyObject *__pyx_pf_7sweepea_5Query_14paginate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_page, PyObject *__pyx_v_n) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("paginate", 0);
  __Pyx_INCREF(__pyx_v_page);

  /* "sweepea.pyx":2479
 *     @Node.copy
 *     def paginate(self, page, n=20):
 *         if page > 0:             # <<<<<<<<<<<<<<
 *             page -= 1
 *         self._limit = n
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_page, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2479, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2479, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "sweepea.pyx":2480
 *     def paginate(self, page, n=20):
 *         if page > 0:
 *             page -= 1             # <<<<<<<<<<<<<<
 *         self._limit = n
 *         self._offset = page * n
 */
    __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_page, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_page, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "sweepea.pyx":2479
 *     @Node.copy
 *     def paginate(self, page, n=20):
 *         if page > 0:             # <<<<<<<<<<<<<<
 *             page -= 1
 *         self._limit = n
 */
  }

  /* "sweepea.pyx":2481
 *         if page > 0:
 *             page -= 1
 *         self._limit = n             # <<<<<<<<<<<<<<
 *         self._offset = page * n
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_limit_2, __pyx_v_n) < 0) __PYX_ERR(0, 2481, __pyx_L1_error)

  /* "sweepea.pyx":2482
 *             page -= 1
 *         self._limit = n
 *         self._offset = page * n             # <<<<<<<<<<<<<<
 * 
 *     def apply_ordering(self, Context ctx):
 */
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_page, __pyx_v_n); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2482, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset_2, __pyx_t_1) < 0) __PYX_ERR(0, 2482, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2478
 * 
 *     @Node.copy
 *     def paginate(self, page, n=20):             # <<<<<<<<<<<<<<
 *         if page > 0:
 *             page -= 1
 */

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

/* "sweepea.pyx":2484
 *         self._offset = page * n
 * 
 *     def apply_ordering(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self._order_by:
 *             ctx.literal(' ORDER BY ').sql(CommaList(self._order_by))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Query_17apply_ordering(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Query_17apply_ordering = {"apply_ordering", (PyCFunction)__pyx_pw_7sweepea_5Query_17apply_ordering, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Query_17apply_ordering(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("apply_ordering (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("apply_ordering", 1, 2, 2, 1); __PYX_ERR(0, 2484, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "apply_ordering") < 0)) __PYX_ERR(0, 2484, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("apply_ordering", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2484, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Query.apply_ordering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2484, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_5Query_16apply_ordering(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_5Query_16apply_ordering(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("apply_ordering", 0);

  /* "sweepea.pyx":2485
 * 
 *     def apply_ordering(self, Context ctx):
 *         if self._order_by:             # <<<<<<<<<<<<<<
 *             ctx.literal(' ORDER BY ').sql(CommaList(self._order_by))
 *         if self._limit is not None or self._offset is not None:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_order_by_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2485, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2485, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "sweepea.pyx":2486
 *     def apply_ordering(self, Context ctx):
 *         if self._order_by:
 *             ctx.literal(' ORDER BY ').sql(CommaList(self._order_by))             # <<<<<<<<<<<<<<
 *         if self._limit is not None or self._offset is not None:
 *             ctx.literal(' LIMIT %d' % (self._limit or -1))
 */
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_ORDER_BY, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_CommaList); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_order_by_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_6) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2486, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2486, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2486, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_1)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_1), __pyx_t_3, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "sweepea.pyx":2485
 * 
 *     def apply_ordering(self, Context ctx):
 *         if self._order_by:             # <<<<<<<<<<<<<<
 *             ctx.literal(' ORDER BY ').sql(CommaList(self._order_by))
 *         if self._limit is not None or self._offset is not None:
 */
  }

  /* "sweepea.pyx":2487
 *         if self._order_by:
 *             ctx.literal(' ORDER BY ').sql(CommaList(self._order_by))
 *         if self._limit is not None or self._offset is not None:             # <<<<<<<<<<<<<<
 *             ctx.literal(' LIMIT %d' % (self._limit or -1))
 *         if self._offset is not None:
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_limit_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_8 = (__pyx_t_4 != Py_None);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (!__pyx_t_9) {
  } else {
    __pyx_t_2 = __pyx_t_9;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = (__pyx_t_4 != Py_None);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = (__pyx_t_9 != 0);
  __pyx_t_2 = __pyx_t_8;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_2) {

    /* "sweepea.pyx":2488
 *             ctx.literal(' ORDER BY ').sql(CommaList(self._order_by))
 *         if self._limit is not None or self._offset is not None:
 *             ctx.literal(' LIMIT %d' % (self._limit or -1))             # <<<<<<<<<<<<<<
 *         if self._offset is not None:
 *             ctx.literal(' OFFSET %d' % self._offset)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_limit_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2488, __pyx_L1_error)
    if (!__pyx_t_2) {
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = __pyx_t_3;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyInt_From_long(-1L); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __pyx_t_3;
    __pyx_t_3 = 0;
    __pyx_L7_bool_binop_done:;
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_LIMIT_d, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_t_3, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "sweepea.pyx":2487
 *         if self._order_by:
 *             ctx.literal(' ORDER BY ').sql(CommaList(self._order_by))
 *         if self._limit is not None or self._offset is not None:             # <<<<<<<<<<<<<<
 *             ctx.literal(' LIMIT %d' % (self._limit or -1))
 *         if self._offset is not None:
 */
  }

  /* "sweepea.pyx":2489
 *         if self._limit is not None or self._offset is not None:
 *             ctx.literal(' LIMIT %d' % (self._limit or -1))
 *         if self._offset is not None:             # <<<<<<<<<<<<<<
 *             ctx.literal(' OFFSET %d' % self._offset)
 *         return ctx
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = (__pyx_t_4 != Py_None);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_8 = (__pyx_t_2 != 0);
  if (__pyx_t_8) {

    /* "sweepea.pyx":2490
 *             ctx.literal(' LIMIT %d' % (self._limit or -1))
 *         if self._offset is not None:
 *             ctx.literal(' OFFSET %d' % self._offset)             # <<<<<<<<<<<<<<
 *         return ctx
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_offset_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_OFFSET_d, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_t_3, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "sweepea.pyx":2489
 *         if self._limit is not None or self._offset is not None:
 *             ctx.literal(' LIMIT %d' % (self._limit or -1))
 *         if self._offset is not None:             # <<<<<<<<<<<<<<
 *             ctx.literal(' OFFSET %d' % self._offset)
 *         return ctx
 */
  }

  /* "sweepea.pyx":2491
 *         if self._offset is not None:
 *             ctx.literal(' OFFSET %d' % self._offset)
 *         return ctx             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
  __pyx_r = ((PyObject *)__pyx_v_ctx);
  goto __pyx_L0;

  /* "sweepea.pyx":2484
 *         self._offset = page * n
 * 
 *     def apply_ordering(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self._order_by:
 *             ctx.literal(' ORDER BY ').sql(CommaList(self._order_by))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("sweepea.Query.apply_ordering", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2493
 *         return ctx
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self._cte_list:
 *             recursive = any(cte._recursive for cte in self._cte_list)
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Query_19__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Query_19__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_5Query_19__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Query_19__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2493, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2493, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2493, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Query.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2493, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_5Query_18__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_7sweepea_5Query_7__sql___2generator3(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "sweepea.pyx":2495
 *     def __sql__(self, Context ctx):
 *         if self._cte_list:
 *             recursive = any(cte._recursive for cte in self._cte_list)             # <<<<<<<<<<<<<<
 *             with ctx.scope_cte():
 *                 (ctx
 */

static PyObject *__pyx_pf_7sweepea_5Query_7__sql___genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr *)__pyx_tp_new_7sweepea___pyx_scope_struct_18_genexpr(__pyx_ptype_7sweepea___pyx_scope_struct_18_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__ *) __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_7sweepea_5Query_7__sql___2generator3, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_Query___sql___locals_genexpr, __pyx_n_s_sweepea); if (unlikely(!gen)) __PYX_ERR(0, 2495, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("sweepea.Query.__sql__.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_7sweepea_5Query_7__sql___2generator3(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr *__pyx_cur_scope = ((struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  int __pyx_t_5;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 2495, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 2495, __pyx_L1_error) }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self, __pyx_n_s_cte_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2495, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2495, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2495, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2495, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2495, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        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, 2495, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_cte);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_cte, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_cte, __pyx_n_s_recursive_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2495, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_5) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(Py_True);
      __pyx_r = Py_True;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      goto __pyx_L0;
    }
  }
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_False);
    __pyx_r = Py_False;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2493
 *         return ctx
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self._cte_list:
 *             recursive = any(cte._recursive for cte in self._cte_list)
 */

static PyObject *__pyx_pf_7sweepea_5Query_18__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__ *__pyx_cur_scope;
  PyObject *__pyx_v_recursive = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  __Pyx_RefNannySetupContext("__sql__", 0);
  __pyx_cur_scope = (struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__ *)__pyx_tp_new_7sweepea___pyx_scope_struct_17___sql__(__pyx_ptype_7sweepea___pyx_scope_struct_17___sql__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __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);

  /* "sweepea.pyx":2494
 * 
 *     def __sql__(self, Context ctx):
 *         if self._cte_list:             # <<<<<<<<<<<<<<
 *             recursive = any(cte._recursive for cte in self._cte_list)
 *             with ctx.scope_cte():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_cte_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2494, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "sweepea.pyx":2495
 *     def __sql__(self, Context ctx):
 *         if self._cte_list:
 *             recursive = any(cte._recursive for cte in self._cte_list)             # <<<<<<<<<<<<<<
 *             with ctx.scope_cte():
 *                 (ctx
 */
    __pyx_t_1 = __pyx_pf_7sweepea_5Query_7__sql___genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_Generator_Next(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_recursive = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "sweepea.pyx":2496
 *         if self._cte_list:
 *             recursive = any(cte._recursive for cte in self._cte_list)
 *             with ctx.scope_cte():             # <<<<<<<<<<<<<<
 *                 (ctx
 *                  .literal('WITH RECURSIVE ' if recursive else 'WITH ')
 */
    /*with:*/ {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ctx), __pyx_n_s_scope_cte); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2496, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_4 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2496, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2496, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2496, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2496, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
        }
      }
      if (__pyx_t_6) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2496, __pyx_L4_error)
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2496, __pyx_L4_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      /*try:*/ {
        {
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          /*try:*/ {

            /* "sweepea.pyx":2498
 *             with ctx.scope_cte():
 *                 (ctx
 *                  .literal('WITH RECURSIVE ' if recursive else 'WITH ')             # <<<<<<<<<<<<<<
 *                  .sql(CommaList(self._cte_list))
 *                  .literal(' '))
 */
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_recursive); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2498, __pyx_L8_error)
            if (__pyx_t_2) {
              __Pyx_INCREF(__pyx_kp_s_WITH_RECURSIVE);
              __pyx_t_3 = __pyx_kp_s_WITH_RECURSIVE;
            } else {
              __Pyx_INCREF(__pyx_kp_s_WITH);
              __pyx_t_3 = __pyx_kp_s_WITH;
            }
            __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2498, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "sweepea.pyx":2499
 *                 (ctx
 *                  .literal('WITH RECURSIVE ' if recursive else 'WITH ')
 *                  .sql(CommaList(self._cte_list))             # <<<<<<<<<<<<<<
 *                  .literal(' '))
 *         return ctx
 */
            __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_CommaList); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2499, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self, __pyx_n_s_cte_list); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2499, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_6);
            __pyx_t_10 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && 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_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2499, __pyx_L8_error)
              __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
              __Pyx_GOTREF(__pyx_t_3);
            } else {
              __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2499, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_11);
              __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
              __Pyx_GIVEREF(__pyx_t_6);
              PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_6);
              __pyx_t_6 = 0;
              __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2499, __pyx_L8_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_1)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_1), __pyx_t_3, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2499, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "sweepea.pyx":2500
 *                  .literal('WITH RECURSIVE ' if recursive else 'WITH ')
 *                  .sql(CommaList(self._cte_list))
 *                  .literal(' '))             # <<<<<<<<<<<<<<
 *         return ctx
 * 
 */
            __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_4)->__pyx_vtab)->literal(((struct __pyx_obj_7sweepea_Context *)__pyx_t_4), __pyx_kp_s__57, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2500, __pyx_L8_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "sweepea.pyx":2496
 *         if self._cte_list:
 *             recursive = any(cte._recursive for cte in self._cte_list)
 *             with ctx.scope_cte():             # <<<<<<<<<<<<<<
 *                 (ctx
 *                  .literal('WITH RECURSIVE ' if recursive else 'WITH ')
 */
          }
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          goto __pyx_L15_try_end;
          __pyx_L8_error:;
          __Pyx_PyThreadState_assign
          __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          /*except:*/ {
            __Pyx_AddTraceback("sweepea.Query.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_1) < 0) __PYX_ERR(0, 2496, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_11 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2496, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2496, __pyx_L10_except_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_12);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
            if (__pyx_t_2 < 0) __PYX_ERR(0, 2496, __pyx_L10_except_error)
            __pyx_t_13 = ((!(__pyx_t_2 != 0)) != 0);
            if (__pyx_t_13) {
              __Pyx_GIVEREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_4);
              __Pyx_XGIVEREF(__pyx_t_1);
              __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_4, __pyx_t_1);
              __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_1 = 0; 
              __PYX_ERR(0, 2496, __pyx_L10_except_error)
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            goto __pyx_L9_exception_handled;
          }
          __pyx_L10_except_error:;
          __Pyx_PyThreadState_assign
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          goto __pyx_L1_error;
          __pyx_L9_exception_handled:;
          __Pyx_PyThreadState_assign
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          __pyx_L15_try_end:;
        }
      }
      /*finally:*/ {
        /*normal exit:*/{
          if (__pyx_t_5) {
            __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__73, NULL);
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2496, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          }
          goto __pyx_L7;
        }
        __pyx_L7:;
      }
      goto __pyx_L19;
      __pyx_L4_error:;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L1_error;
      __pyx_L19:;
    }

    /* "sweepea.pyx":2494
 * 
 *     def __sql__(self, Context ctx):
 *         if self._cte_list:             # <<<<<<<<<<<<<<
 *             recursive = any(cte._recursive for cte in self._cte_list)
 *             with ctx.scope_cte():
 */
  }

  /* "sweepea.pyx":2501
 *                  .sql(CommaList(self._cte_list))
 *                  .literal(' '))
 *         return ctx             # <<<<<<<<<<<<<<
 * 
 *     def execute(self, database):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
  __pyx_r = ((PyObject *)__pyx_v_ctx);
  goto __pyx_L0;

  /* "sweepea.pyx":2493
 *         return ctx
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self._cte_list:
 *             recursive = any(cte._recursive for cte in self._cte_list)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("sweepea.Query.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_recursive);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2503
 *         return ctx
 * 
 *     def execute(self, database):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_5Query_21execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_5Query_21execute = {"execute", (PyCFunction)__pyx_pw_7sweepea_5Query_21execute, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_5Query_21execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_database = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_database,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_database)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, 1); __PYX_ERR(0, 2503, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute") < 0)) __PYX_ERR(0, 2503, __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_database = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2503, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Query.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_5Query_20execute(__pyx_self, __pyx_v_self, __pyx_v_database);

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

static PyObject *__pyx_pf_7sweepea_5Query_20execute(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_database) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute", 0);

  /* "sweepea.pyx":2504
 * 
 *     def execute(self, database):
 *         raise NotImplementedError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
  __PYX_ERR(0, 2504, __pyx_L1_error)

  /* "sweepea.pyx":2503
 *         return ctx
 * 
 *     def execute(self, database):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("sweepea.Query.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2510
 *     commit = False
 * 
 *     def __add__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'UNION ALL', rhs)
 *     def __or__(self, rhs):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10SelectBase_1__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10SelectBase_1__add__ = {"__add__", (PyCFunction)__pyx_pw_7sweepea_10SelectBase_1__add__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10SelectBase_1__add__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_rhs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_rhs,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_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, 1); __PYX_ERR(0, 2510, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__add__") < 0)) __PYX_ERR(0, 2510, __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_rhs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__add__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2510, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.SelectBase.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10SelectBase___add__(__pyx_self, __pyx_v_self, __pyx_v_rhs);

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

static PyObject *__pyx_pf_7sweepea_10SelectBase___add__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__add__", 0);

  /* "sweepea.pyx":2511
 * 
 *     def __add__(self, rhs):
 *         return CompoundSelect(self, 'UNION ALL', rhs)             # <<<<<<<<<<<<<<
 *     def __or__(self, rhs):
 *         return CompoundSelect(self, 'UNION', rhs)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_CompoundSelect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
  __Pyx_INCREF(__pyx_kp_s_UNION_ALL);
  __Pyx_GIVEREF(__pyx_kp_s_UNION_ALL);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_kp_s_UNION_ALL);
  __Pyx_INCREF(__pyx_v_rhs);
  __Pyx_GIVEREF(__pyx_v_rhs);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_rhs);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2511, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2510
 *     commit = False
 * 
 *     def __add__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'UNION ALL', rhs)
 *     def __or__(self, rhs):
 */

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

/* "sweepea.pyx":2512
 *     def __add__(self, rhs):
 *         return CompoundSelect(self, 'UNION ALL', rhs)
 *     def __or__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'UNION', rhs)
 *     def __and__(self, rhs):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10SelectBase_3__or__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10SelectBase_3__or__ = {"__or__", (PyCFunction)__pyx_pw_7sweepea_10SelectBase_3__or__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10SelectBase_3__or__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_rhs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__or__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_rhs,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_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__or__", 1, 2, 2, 1); __PYX_ERR(0, 2512, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__or__") < 0)) __PYX_ERR(0, 2512, __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_rhs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__or__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2512, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.SelectBase.__or__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10SelectBase_2__or__(__pyx_self, __pyx_v_self, __pyx_v_rhs);

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

static PyObject *__pyx_pf_7sweepea_10SelectBase_2__or__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__or__", 0);

  /* "sweepea.pyx":2513
 *         return CompoundSelect(self, 'UNION ALL', rhs)
 *     def __or__(self, rhs):
 *         return CompoundSelect(self, 'UNION', rhs)             # <<<<<<<<<<<<<<
 *     def __and__(self, rhs):
 *         return CompoundSelect(self, 'INTERSECT', rhs)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_CompoundSelect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
  __Pyx_INCREF(__pyx_n_s_UNION);
  __Pyx_GIVEREF(__pyx_n_s_UNION);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_UNION);
  __Pyx_INCREF(__pyx_v_rhs);
  __Pyx_GIVEREF(__pyx_v_rhs);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_rhs);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2513, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2512
 *     def __add__(self, rhs):
 *         return CompoundSelect(self, 'UNION ALL', rhs)
 *     def __or__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'UNION', rhs)
 *     def __and__(self, rhs):
 */

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

/* "sweepea.pyx":2514
 *     def __or__(self, rhs):
 *         return CompoundSelect(self, 'UNION', rhs)
 *     def __and__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'INTERSECT', rhs)
 *     def __sub__(self, rhs):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10SelectBase_5__and__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10SelectBase_5__and__ = {"__and__", (PyCFunction)__pyx_pw_7sweepea_10SelectBase_5__and__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10SelectBase_5__and__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_rhs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__and__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_rhs,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_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__and__", 1, 2, 2, 1); __PYX_ERR(0, 2514, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__and__") < 0)) __PYX_ERR(0, 2514, __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_rhs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__and__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2514, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.SelectBase.__and__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10SelectBase_4__and__(__pyx_self, __pyx_v_self, __pyx_v_rhs);

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

static PyObject *__pyx_pf_7sweepea_10SelectBase_4__and__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__and__", 0);

  /* "sweepea.pyx":2515
 *         return CompoundSelect(self, 'UNION', rhs)
 *     def __and__(self, rhs):
 *         return CompoundSelect(self, 'INTERSECT', rhs)             # <<<<<<<<<<<<<<
 *     def __sub__(self, rhs):
 *         return CompoundSelect(self, 'EXCEPT', rhs)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_CompoundSelect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
  __Pyx_INCREF(__pyx_n_s_INTERSECT);
  __Pyx_GIVEREF(__pyx_n_s_INTERSECT);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_INTERSECT);
  __Pyx_INCREF(__pyx_v_rhs);
  __Pyx_GIVEREF(__pyx_v_rhs);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_rhs);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2515, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2514
 *     def __or__(self, rhs):
 *         return CompoundSelect(self, 'UNION', rhs)
 *     def __and__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'INTERSECT', rhs)
 *     def __sub__(self, rhs):
 */

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

/* "sweepea.pyx":2516
 *     def __and__(self, rhs):
 *         return CompoundSelect(self, 'INTERSECT', rhs)
 *     def __sub__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'EXCEPT', rhs)
 *     def cte(self, name, recursive=False, columns=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10SelectBase_7__sub__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10SelectBase_7__sub__ = {"__sub__", (PyCFunction)__pyx_pw_7sweepea_10SelectBase_7__sub__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10SelectBase_7__sub__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_rhs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_rhs,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_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sub__", 1, 2, 2, 1); __PYX_ERR(0, 2516, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sub__") < 0)) __PYX_ERR(0, 2516, __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_rhs = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sub__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2516, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.SelectBase.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10SelectBase_6__sub__(__pyx_self, __pyx_v_self, __pyx_v_rhs);

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

static PyObject *__pyx_pf_7sweepea_10SelectBase_6__sub__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_rhs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__sub__", 0);

  /* "sweepea.pyx":2517
 *         return CompoundSelect(self, 'INTERSECT', rhs)
 *     def __sub__(self, rhs):
 *         return CompoundSelect(self, 'EXCEPT', rhs)             # <<<<<<<<<<<<<<
 *     def cte(self, name, recursive=False, columns=None):
 *         return CTE(name, self, recursive, columns)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_CompoundSelect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_self);
  __Pyx_INCREF(__pyx_n_s_EXCEPT);
  __Pyx_GIVEREF(__pyx_n_s_EXCEPT);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_n_s_EXCEPT);
  __Pyx_INCREF(__pyx_v_rhs);
  __Pyx_GIVEREF(__pyx_v_rhs);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_rhs);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2517, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2516
 *     def __and__(self, rhs):
 *         return CompoundSelect(self, 'INTERSECT', rhs)
 *     def __sub__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'EXCEPT', rhs)
 *     def cte(self, name, recursive=False, columns=None):
 */

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

/* "sweepea.pyx":2518
 *     def __sub__(self, rhs):
 *         return CompoundSelect(self, 'EXCEPT', rhs)
 *     def cte(self, name, recursive=False, columns=None):             # <<<<<<<<<<<<<<
 *         return CTE(name, self, recursive, columns)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10SelectBase_9cte(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10SelectBase_9cte = {"cte", (PyCFunction)__pyx_pw_7sweepea_10SelectBase_9cte, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10SelectBase_9cte(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_recursive = 0;
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cte (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_name,&__pyx_n_s_recursive,&__pyx_n_s_columns,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_False));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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_name)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("cte", 0, 2, 4, 1); __PYX_ERR(0, 2518, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_recursive);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_columns);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "cte") < 0)) __PYX_ERR(0, 2518, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_name = values[1];
    __pyx_v_recursive = values[2];
    __pyx_v_columns = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("cte", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2518, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.SelectBase.cte", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10SelectBase_8cte(__pyx_self, __pyx_v_self, __pyx_v_name, __pyx_v_recursive, __pyx_v_columns);

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

static PyObject *__pyx_pf_7sweepea_10SelectBase_8cte(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_recursive, PyObject *__pyx_v_columns) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("cte", 0);

  /* "sweepea.pyx":2519
 *         return CompoundSelect(self, 'EXCEPT', rhs)
 *     def cte(self, name, recursive=False, columns=None):
 *         return CTE(name, self, recursive, columns)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_CTE); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(4+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_name);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_self);
  __Pyx_INCREF(__pyx_v_recursive);
  __Pyx_GIVEREF(__pyx_v_recursive);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_v_recursive);
  __Pyx_INCREF(__pyx_v_columns);
  __Pyx_GIVEREF(__pyx_v_columns);
  PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_v_columns);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2519, __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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2518
 *     def __sub__(self, rhs):
 *         return CompoundSelect(self, 'EXCEPT', rhs)
 *     def cte(self, name, recursive=False, columns=None):             # <<<<<<<<<<<<<<
 *         return CTE(name, self, recursive, columns)
 * 
 */

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

/* "sweepea.pyx":2523
 * 
 * class CompoundSelect(SelectBase):
 *     def __init__(self, lhs, op, rhs):             # <<<<<<<<<<<<<<
 *         super(CompoundSelect, self).__init__()
 *         self.lhs = lhs
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_14CompoundSelect_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_14CompoundSelect_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_14CompoundSelect_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_14CompoundSelect_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_lhs = 0;
  PyObject *__pyx_v_op = 0;
  PyObject *__pyx_v_rhs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_lhs,&__pyx_n_s_op,&__pyx_n_s_rhs,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_lhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 2523, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 2523, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rhs)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 2523, __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, 2523, __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_lhs = values[1];
    __pyx_v_op = values[2];
    __pyx_v_rhs = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2523, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.CompoundSelect.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_14CompoundSelect___init__(__pyx_self, __pyx_v_self, __pyx_v_lhs, __pyx_v_op, __pyx_v_rhs);

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

static PyObject *__pyx_pf_7sweepea_14CompoundSelect___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_lhs, PyObject *__pyx_v_op, PyObject *__pyx_v_rhs) {
  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);

  /* "sweepea.pyx":2524
 * class CompoundSelect(SelectBase):
 *     def __init__(self, lhs, op, rhs):
 *         super(CompoundSelect, self).__init__()             # <<<<<<<<<<<<<<
 *         self.lhs = lhs
 *         self.op = op
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_CompoundSelect); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2524, __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, 2524, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2525
 *     def __init__(self, lhs, op, rhs):
 *         super(CompoundSelect, self).__init__()
 *         self.lhs = lhs             # <<<<<<<<<<<<<<
 *         self.op = op
 *         self.rhs = rhs
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_lhs, __pyx_v_lhs) < 0) __PYX_ERR(0, 2525, __pyx_L1_error)

  /* "sweepea.pyx":2526
 *         super(CompoundSelect, self).__init__()
 *         self.lhs = lhs
 *         self.op = op             # <<<<<<<<<<<<<<
 *         self.rhs = rhs
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_op, __pyx_v_op) < 0) __PYX_ERR(0, 2526, __pyx_L1_error)

  /* "sweepea.pyx":2527
 *         self.lhs = lhs
 *         self.op = op
 *         self.rhs = rhs             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_rhs, __pyx_v_rhs) < 0) __PYX_ERR(0, 2527, __pyx_L1_error)

  /* "sweepea.pyx":2523
 * 
 * class CompoundSelect(SelectBase):
 *     def __init__(self, lhs, op, rhs):             # <<<<<<<<<<<<<<
 *         super(CompoundSelect, self).__init__()
 *         self.lhs = lhs
 */

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

/* "sweepea.pyx":2529
 *         self.rhs = rhs
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         with ctx(parentheses=ctx.scope == SCOPE_SOURCE):
 *             with ctx(parentheses=False):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_14CompoundSelect_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_14CompoundSelect_3__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_14CompoundSelect_3__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_14CompoundSelect_3__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2529, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2529, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2529, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.CompoundSelect.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2529, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_14CompoundSelect_2__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_14CompoundSelect_2__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("__sql__", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_ctx);

  /* "sweepea.pyx":2530
 * 
 *     def __sql__(self, Context ctx):
 *         with ctx(parentheses=ctx.scope == SCOPE_SOURCE):             # <<<<<<<<<<<<<<
 *             with ctx(parentheses=False):
 *                 ctx.sql(self.lhs)
 */
  /*with:*/ {
    __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ctx->scope); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCOPE_SOURCE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2530, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_parentheses, __pyx_t_4) < 0) __PYX_ERR(0, 2530, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_ctx), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2530, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2530, __pyx_L3_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, 2530, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "sweepea.pyx":2531
 *     def __sql__(self, Context ctx):
 *         with ctx(parentheses=ctx.scope == SCOPE_SOURCE):
 *             with ctx(parentheses=False):             # <<<<<<<<<<<<<<
 *                 ctx.sql(self.lhs)
 *             ctx.literal(' %s ' % self.op)
 */
          /*with:*/ {
            __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2531, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_parentheses, Py_False) < 0) __PYX_ERR(0, 2531, __pyx_L7_error)
            __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_ctx), __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2531, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2531, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2531, __pyx_L15_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            if (__pyx_t_2) {
              __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2531, __pyx_L15_error)
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            } else {
              __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2531, __pyx_L15_error)
            }
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
                __Pyx_XGOTREF(__pyx_t_10);
                __Pyx_XGOTREF(__pyx_t_11);
                __Pyx_XGOTREF(__pyx_t_12);
                /*try:*/ {

                  /* "sweepea.pyx":2532
 *         with ctx(parentheses=ctx.scope == SCOPE_SOURCE):
 *             with ctx(parentheses=False):
 *                 ctx.sql(self.lhs)             # <<<<<<<<<<<<<<
 *             ctx.literal(' %s ' % self.op)
 *             with ctx(parentheses=False):
 */
                  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lhs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2532, __pyx_L21_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_1, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2532, __pyx_L21_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                  /* "sweepea.pyx":2531
 *     def __sql__(self, Context ctx):
 *         with ctx(parentheses=ctx.scope == SCOPE_SOURCE):
 *             with ctx(parentheses=False):             # <<<<<<<<<<<<<<
 *                 ctx.sql(self.lhs)
 *             ctx.literal(' %s ' % self.op)
 */
                }
                __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                goto __pyx_L28_try_end;
                __pyx_L21_error:;
                __Pyx_PyThreadState_assign
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("sweepea.CompoundSelect.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 2531, __pyx_L23_except_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_GOTREF(__pyx_t_3);
                  __pyx_t_2 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2531, __pyx_L23_except_error)
                  __Pyx_GOTREF(__pyx_t_2);
                  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL);
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2531, __pyx_L23_except_error)
                  __Pyx_GOTREF(__pyx_t_13);
                  __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_13);
                  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                  if (__pyx_t_14 < 0) __PYX_ERR(0, 2531, __pyx_L23_except_error)
                  __pyx_t_15 = ((!(__pyx_t_14 != 0)) != 0);
                  if (__pyx_t_15) {
                    __Pyx_GIVEREF(__pyx_t_4);
                    __Pyx_GIVEREF(__pyx_t_1);
                    __Pyx_XGIVEREF(__pyx_t_3);
                    __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_1, __pyx_t_3);
                    __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; 
                    __PYX_ERR(0, 2531, __pyx_L23_except_error)
                  }
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  goto __pyx_L22_exception_handled;
                }
                __pyx_L23_except_error:;
                __Pyx_PyThreadState_assign
                __Pyx_XGIVEREF(__pyx_t_10);
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
                goto __pyx_L7_error;
                __pyx_L22_exception_handled:;
                __Pyx_PyThreadState_assign
                __Pyx_XGIVEREF(__pyx_t_10);
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
                __pyx_L28_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_9) {
                  __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__74, NULL);
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                  if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2531, __pyx_L7_error)
                  __Pyx_GOTREF(__pyx_t_12);
                  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
                }
                goto __pyx_L20;
              }
              __pyx_L20:;
            }
            goto __pyx_L32;
            __pyx_L15_error:;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L7_error;
            __pyx_L32:;
          }

          /* "sweepea.pyx":2533
 *             with ctx(parentheses=False):
 *                 ctx.sql(self.lhs)
 *             ctx.literal(' %s ' % self.op)             # <<<<<<<<<<<<<<
 *             with ctx(parentheses=False):
 *                 ctx.sql(self.rhs)
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_op); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2533, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2533, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_t_1, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2533, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "sweepea.pyx":2534
 *                 ctx.sql(self.lhs)
 *             ctx.literal(' %s ' % self.op)
 *             with ctx(parentheses=False):             # <<<<<<<<<<<<<<
 *                 ctx.sql(self.rhs)
 *         ctx = self.apply_ordering(ctx)
 */
          /*with:*/ {
            __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2534, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_parentheses, Py_False) < 0) __PYX_ERR(0, 2534, __pyx_L7_error)
            __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_v_ctx), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2534, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_9 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2534, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_9);
            __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2534, __pyx_L33_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            if (__pyx_t_2) {
              __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2534, __pyx_L33_error)
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            } else {
              __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2534, __pyx_L33_error)
            }
            __Pyx_GOTREF(__pyx_t_3);
            __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;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_11, &__pyx_t_10);
                __Pyx_XGOTREF(__pyx_t_12);
                __Pyx_XGOTREF(__pyx_t_11);
                __Pyx_XGOTREF(__pyx_t_10);
                /*try:*/ {

                  /* "sweepea.pyx":2535
 *             ctx.literal(' %s ' % self.op)
 *             with ctx(parentheses=False):
 *                 ctx.sql(self.rhs)             # <<<<<<<<<<<<<<
 *         ctx = self.apply_ordering(ctx)
 *         return self.apply_alias(ctx)
 */
                  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_rhs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2535, __pyx_L39_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_1, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2535, __pyx_L39_error)
                  __Pyx_GOTREF(__pyx_t_3);
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

                  /* "sweepea.pyx":2534
 *                 ctx.sql(self.lhs)
 *             ctx.literal(' %s ' % self.op)
 *             with ctx(parentheses=False):             # <<<<<<<<<<<<<<
 *                 ctx.sql(self.rhs)
 *         ctx = self.apply_ordering(ctx)
 */
                }
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
                goto __pyx_L46_try_end;
                __pyx_L39_error:;
                __Pyx_PyThreadState_assign
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("sweepea.CompoundSelect.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_4) < 0) __PYX_ERR(0, 2534, __pyx_L41_except_error)
                  __Pyx_GOTREF(__pyx_t_3);
                  __Pyx_GOTREF(__pyx_t_1);
                  __Pyx_GOTREF(__pyx_t_4);
                  __pyx_t_2 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2534, __pyx_L41_except_error)
                  __Pyx_GOTREF(__pyx_t_2);
                  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_2, NULL);
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2534, __pyx_L41_except_error)
                  __Pyx_GOTREF(__pyx_t_13);
                  __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_13);
                  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                  if (__pyx_t_15 < 0) __PYX_ERR(0, 2534, __pyx_L41_except_error)
                  __pyx_t_14 = ((!(__pyx_t_15 != 0)) != 0);
                  if (__pyx_t_14) {
                    __Pyx_GIVEREF(__pyx_t_3);
                    __Pyx_GIVEREF(__pyx_t_1);
                    __Pyx_XGIVEREF(__pyx_t_4);
                    __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_4);
                    __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_4 = 0; 
                    __PYX_ERR(0, 2534, __pyx_L41_except_error)
                  }
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  goto __pyx_L40_exception_handled;
                }
                __pyx_L41_except_error:;
                __Pyx_PyThreadState_assign
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_10);
                __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
                goto __pyx_L7_error;
                __pyx_L40_exception_handled:;
                __Pyx_PyThreadState_assign
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_10);
                __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_11, __pyx_t_10);
                __pyx_L46_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_9) {
                  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_tuple__75, NULL);
                  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
                  if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2534, __pyx_L7_error)
                  __Pyx_GOTREF(__pyx_t_10);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                }
                goto __pyx_L38;
              }
              __pyx_L38:;
            }
            goto __pyx_L50;
            __pyx_L33_error:;
            __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            goto __pyx_L7_error;
            __pyx_L50:;
          }

          /* "sweepea.pyx":2530
 * 
 *     def __sql__(self, Context ctx):
 *         with ctx(parentheses=ctx.scope == SCOPE_SOURCE):             # <<<<<<<<<<<<<<
 *             with ctx(parentheses=False):
 *                 ctx.sql(self.lhs)
 */
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("sweepea.CompoundSelect.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 2530, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2530, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2530, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_9);
          __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
          if (__pyx_t_14 < 0) __PYX_ERR(0, 2530, __pyx_L9_except_error)
          __pyx_t_15 = ((!(__pyx_t_14 != 0)) != 0);
          if (__pyx_t_15) {
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_1);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_1, __pyx_t_3);
            __pyx_t_4 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0; 
            __PYX_ERR(0, 2530, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_5) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__76, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2530, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L54;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L1_error;
    __pyx_L54:;
  }

  /* "sweepea.pyx":2536
 *             with ctx(parentheses=False):
 *                 ctx.sql(self.rhs)
 *         ctx = self.apply_ordering(ctx)             # <<<<<<<<<<<<<<
 *         return self.apply_alias(ctx)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_apply_ordering); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_ctx)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
    PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_ctx));
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7sweepea_Context))))) __PYX_ERR(0, 2536, __pyx_L1_error)
  __Pyx_DECREF_SET(__pyx_v_ctx, ((struct __pyx_obj_7sweepea_Context *)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "sweepea.pyx":2537
 *                 ctx.sql(self.rhs)
 *         ctx = self.apply_ordering(ctx)
 *         return self.apply_alias(ctx)             # <<<<<<<<<<<<<<
 * 
 *     def execute(self, database):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_apply_alias); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_ctx)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_ctx));
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2537, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2529
 *         self.rhs = rhs
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         with ctx(parentheses=ctx.scope == SCOPE_SOURCE):
 *             with ctx(parentheses=False):
 */

  /* 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("sweepea.CompoundSelect.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ctx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2539
 *         return self.apply_alias(ctx)
 * 
 *     def execute(self, database):             # <<<<<<<<<<<<<<
 *         return CursorWrapper(database.execute(self))
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_14CompoundSelect_5execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_14CompoundSelect_5execute = {"execute", (PyCFunction)__pyx_pw_7sweepea_14CompoundSelect_5execute, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_14CompoundSelect_5execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_database = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_database,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_database)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, 1); __PYX_ERR(0, 2539, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute") < 0)) __PYX_ERR(0, 2539, __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_database = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2539, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.CompoundSelect.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_14CompoundSelect_4execute(__pyx_self, __pyx_v_self, __pyx_v_database);

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

static PyObject *__pyx_pf_7sweepea_14CompoundSelect_4execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_database) {
  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("execute", 0);

  /* "sweepea.pyx":2540
 * 
 *     def execute(self, database):
 *         return CursorWrapper(database.execute(self))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_database, __pyx_n_s_execute); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2540, __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_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_self);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea_CursorWrapper), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2540, __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;

  /* "sweepea.pyx":2539
 *         return self.apply_alias(ctx)
 * 
 *     def execute(self, database):             # <<<<<<<<<<<<<<
 *         return CursorWrapper(database.execute(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("sweepea.CompoundSelect.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2544
 * 
 * class Select(SelectBase):
 *     def __init__(self, from_clause=None, columns=None, where=None,             # <<<<<<<<<<<<<<
 *                  group_by=None, having=None, order_by=None, limit=None,
 *                  offset=None, distinct=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Select_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Select_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_6Select_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Select_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_from_clause = 0;
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_v_where = 0;
  PyObject *__pyx_v_group_by = 0;
  PyObject *__pyx_v_having = 0;
  PyObject *__pyx_v_order_by = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_distinct = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_from_clause,&__pyx_n_s_columns,&__pyx_n_s_where,&__pyx_n_s_group_by,&__pyx_n_s_having,&__pyx_n_s_order_by,&__pyx_n_s_limit,&__pyx_n_s_offset,&__pyx_n_s_distinct,0};
    PyObject* values[10] = {0,0,0,0,0,0,0,0,0,0};
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));

    /* "sweepea.pyx":2545
 * class Select(SelectBase):
 *     def __init__(self, from_clause=None, columns=None, where=None,
 *                  group_by=None, having=None, order_by=None, limit=None,             # <<<<<<<<<<<<<<
 *                  offset=None, distinct=None):
 *         super(Select, self).__init__()
 */
    values[4] = ((PyObject *)((PyObject *)Py_None));
    values[5] = ((PyObject *)((PyObject *)Py_None));
    values[6] = ((PyObject *)((PyObject *)Py_None));
    values[7] = ((PyObject *)((PyObject *)Py_None));

    /* "sweepea.pyx":2546
 *     def __init__(self, from_clause=None, columns=None, where=None,
 *                  group_by=None, having=None, order_by=None, limit=None,
 *                  offset=None, distinct=None):             # <<<<<<<<<<<<<<
 *         super(Select, self).__init__()
 *         self._from = (list(from_clause) if isinstance(from_clause, tuple)
 */
    values[8] = ((PyObject *)((PyObject *)Py_None));
    values[9] = ((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 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (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_from_clause);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_columns);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_where);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_group_by);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_having);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_order_by);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[7] = value; kw_args--; }
        }
        case  8:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[8] = value; kw_args--; }
        }
        case  9:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_distinct);
          if (value) { values[9] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2544, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_from_clause = values[1];
    __pyx_v_columns = values[2];
    __pyx_v_where = values[3];
    __pyx_v_group_by = values[4];
    __pyx_v_having = values[5];
    __pyx_v_order_by = values[6];
    __pyx_v_limit = values[7];
    __pyx_v_offset = values[8];
    __pyx_v_distinct = values[9];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 10, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2544, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Select.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Select___init__(__pyx_self, __pyx_v_self, __pyx_v_from_clause, __pyx_v_columns, __pyx_v_where, __pyx_v_group_by, __pyx_v_having, __pyx_v_order_by, __pyx_v_limit, __pyx_v_offset, __pyx_v_distinct);

  /* "sweepea.pyx":2544
 * 
 * class Select(SelectBase):
 *     def __init__(self, from_clause=None, columns=None, where=None,             # <<<<<<<<<<<<<<
 *                  group_by=None, having=None, order_by=None, limit=None,
 *                  offset=None, distinct=None):
 */

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

static PyObject *__pyx_pf_7sweepea_6Select___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_from_clause, PyObject *__pyx_v_columns, PyObject *__pyx_v_where, PyObject *__pyx_v_group_by, PyObject *__pyx_v_having, PyObject *__pyx_v_order_by, PyObject *__pyx_v_limit, PyObject *__pyx_v_offset, PyObject *__pyx_v_distinct) {
  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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":2547
 *                  group_by=None, having=None, order_by=None, limit=None,
 *                  offset=None, distinct=None):
 *         super(Select, self).__init__()             # <<<<<<<<<<<<<<
 *         self._from = (list(from_clause) if isinstance(from_clause, tuple)
 *                       else from_clause)  or []
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Select); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2547, __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, 2547, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2548
 *                  offset=None, distinct=None):
 *         super(Select, self).__init__()
 *         self._from = (list(from_clause) if isinstance(from_clause, tuple)             # <<<<<<<<<<<<<<
 *                       else from_clause)  or []
 *         self._columns = columns
 */
  __pyx_t_4 = PyTuple_Check(__pyx_v_from_clause); 
  if ((__pyx_t_4 != 0)) {
    __pyx_t_2 = PySequence_List(__pyx_v_from_clause); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
    __pyx_t_2 = 0;
  } else {

    /* "sweepea.pyx":2549
 *         super(Select, self).__init__()
 *         self._from = (list(from_clause) if isinstance(from_clause, tuple)
 *                       else from_clause)  or []             # <<<<<<<<<<<<<<
 *         self._columns = columns
 *         self._where = where
 */
    __Pyx_INCREF(__pyx_v_from_clause);
    __pyx_t_3 = __pyx_v_from_clause;
  }
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2548, __pyx_L1_error)
  if (!__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_1 = __pyx_t_3;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_L3_bool_binop_done:;

  /* "sweepea.pyx":2548
 *                  offset=None, distinct=None):
 *         super(Select, self).__init__()
 *         self._from = (list(from_clause) if isinstance(from_clause, tuple)             # <<<<<<<<<<<<<<
 *                       else from_clause)  or []
 *         self._columns = columns
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_from, __pyx_t_1) < 0) __PYX_ERR(0, 2548, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2550
 *         self._from = (list(from_clause) if isinstance(from_clause, tuple)
 *                       else from_clause)  or []
 *         self._columns = columns             # <<<<<<<<<<<<<<
 *         self._where = where
 *         self._group_by = group_by
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_columns_2, __pyx_v_columns) < 0) __PYX_ERR(0, 2550, __pyx_L1_error)

  /* "sweepea.pyx":2551
 *                       else from_clause)  or []
 *         self._columns = columns
 *         self._where = where             # <<<<<<<<<<<<<<
 *         self._group_by = group_by
 *         self._having = having
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_where_2, __pyx_v_where) < 0) __PYX_ERR(0, 2551, __pyx_L1_error)

  /* "sweepea.pyx":2552
 *         self._columns = columns
 *         self._where = where
 *         self._group_by = group_by             # <<<<<<<<<<<<<<
 *         self._having = having
 *         self._order_by = order_by
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_group_by_2, __pyx_v_group_by) < 0) __PYX_ERR(0, 2552, __pyx_L1_error)

  /* "sweepea.pyx":2553
 *         self._where = where
 *         self._group_by = group_by
 *         self._having = having             # <<<<<<<<<<<<<<
 *         self._order_by = order_by
 *         self._limit = limit
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_having_2, __pyx_v_having) < 0) __PYX_ERR(0, 2553, __pyx_L1_error)

  /* "sweepea.pyx":2554
 *         self._group_by = group_by
 *         self._having = having
 *         self._order_by = order_by             # <<<<<<<<<<<<<<
 *         self._limit = limit
 *         self._offset = offset
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_order_by_2, __pyx_v_order_by) < 0) __PYX_ERR(0, 2554, __pyx_L1_error)

  /* "sweepea.pyx":2555
 *         self._having = having
 *         self._order_by = order_by
 *         self._limit = limit             # <<<<<<<<<<<<<<
 *         self._offset = offset
 *         self._distinct = distinct
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_limit_2, __pyx_v_limit) < 0) __PYX_ERR(0, 2555, __pyx_L1_error)

  /* "sweepea.pyx":2556
 *         self._order_by = order_by
 *         self._limit = limit
 *         self._offset = offset             # <<<<<<<<<<<<<<
 *         self._distinct = distinct
 *         self._cursor = None
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_offset_2, __pyx_v_offset) < 0) __PYX_ERR(0, 2556, __pyx_L1_error)

  /* "sweepea.pyx":2557
 *         self._limit = limit
 *         self._offset = offset
 *         self._distinct = distinct             # <<<<<<<<<<<<<<
 *         self._cursor = None
 *         self._dicts = False
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_distinct_2, __pyx_v_distinct) < 0) __PYX_ERR(0, 2557, __pyx_L1_error)

  /* "sweepea.pyx":2558
 *         self._offset = offset
 *         self._distinct = distinct
 *         self._cursor = None             # <<<<<<<<<<<<<<
 *         self._dicts = False
 *         self._objects = False
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_cursor_2, Py_None) < 0) __PYX_ERR(0, 2558, __pyx_L1_error)

  /* "sweepea.pyx":2559
 *         self._distinct = distinct
 *         self._cursor = None
 *         self._dicts = False             # <<<<<<<<<<<<<<
 *         self._objects = False
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_dicts, Py_False) < 0) __PYX_ERR(0, 2559, __pyx_L1_error)

  /* "sweepea.pyx":2560
 *         self._cursor = None
 *         self._dicts = False
 *         self._objects = False             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_objects, Py_False) < 0) __PYX_ERR(0, 2560, __pyx_L1_error)

  /* "sweepea.pyx":2544
 * 
 * class Select(SelectBase):
 *     def __init__(self, from_clause=None, columns=None, where=None,             # <<<<<<<<<<<<<<
 *                  group_by=None, having=None, order_by=None, limit=None,
 *                  offset=None, distinct=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_AddTraceback("sweepea.Select.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2563
 * 
 *     @Node.copy
 *     def select(self, *columns):             # <<<<<<<<<<<<<<
 *         self._columns = columns
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Select_3select(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Select_3select = {"select", (PyCFunction)__pyx_pw_7sweepea_6Select_3select, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Select_3select(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("select (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_columns = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_columns)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_columns);
  } else {
    __pyx_v_columns = __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, "select") < 0)) __PYX_ERR(0, 2563, __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("select", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2563, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_columns); __pyx_v_columns = 0;
  __Pyx_AddTraceback("sweepea.Select.select", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Select_2select(__pyx_self, __pyx_v_self, __pyx_v_columns);

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

static PyObject *__pyx_pf_7sweepea_6Select_2select(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_columns) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("select", 0);

  /* "sweepea.pyx":2564
 *     @Node.copy
 *     def select(self, *columns):
 *         self._columns = columns             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_columns_2, __pyx_v_columns) < 0) __PYX_ERR(0, 2564, __pyx_L1_error)

  /* "sweepea.pyx":2563
 * 
 *     @Node.copy
 *     def select(self, *columns):             # <<<<<<<<<<<<<<
 *         self._columns = columns
 * 
 */

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

/* "sweepea.pyx":2567
 * 
 *     @Node.copy
 *     def join(self, dest, join_type='INNER', on=None):             # <<<<<<<<<<<<<<
 *         if not self._from:
 *             raise ValueError('No sources to join on.')
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Select_5join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Select_5join = {"join", (PyCFunction)__pyx_pw_7sweepea_6Select_5join, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Select_5join(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_dest = 0;
  PyObject *__pyx_v_join_type = 0;
  PyObject *__pyx_v_on = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("join (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_dest,&__pyx_n_s_join_type,&__pyx_n_s_on,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)((PyObject*)__pyx_n_s_INNER));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        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_dest)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("join", 0, 2, 4, 1); __PYX_ERR(0, 2567, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_join_type);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_on);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "join") < 0)) __PYX_ERR(0, 2567, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_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);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_dest = values[1];
    __pyx_v_join_type = values[2];
    __pyx_v_on = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("join", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2567, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Select.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Select_4join(__pyx_self, __pyx_v_self, __pyx_v_dest, __pyx_v_join_type, __pyx_v_on);

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

static PyObject *__pyx_pf_7sweepea_6Select_4join(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_dest, PyObject *__pyx_v_join_type, PyObject *__pyx_v_on) {
  PyObject *__pyx_v_item = 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;
  Py_ssize_t __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("join", 0);

  /* "sweepea.pyx":2568
 *     @Node.copy
 *     def join(self, dest, join_type='INNER', on=None):
 *         if not self._from:             # <<<<<<<<<<<<<<
 *             raise ValueError('No sources to join on.')
 *         item = self._from.pop()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_from); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

    /* "sweepea.pyx":2569
 *     def join(self, dest, join_type='INNER', on=None):
 *         if not self._from:
 *             raise ValueError('No sources to join on.')             # <<<<<<<<<<<<<<
 *         item = self._from.pop()
 *         self._from.append(Join(item, dest, join_type, on))
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2569, __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, 2569, __pyx_L1_error)

    /* "sweepea.pyx":2568
 *     @Node.copy
 *     def join(self, dest, join_type='INNER', on=None):
 *         if not self._from:             # <<<<<<<<<<<<<<
 *             raise ValueError('No sources to join on.')
 *         item = self._from.pop()
 */
  }

  /* "sweepea.pyx":2570
 *         if not self._from:
 *             raise ValueError('No sources to join on.')
 *         item = self._from.pop()             # <<<<<<<<<<<<<<
 *         self._from.append(Join(item, dest, join_type, on))
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_from); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_Pop(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_item = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "sweepea.pyx":2571
 *             raise ValueError('No sources to join on.')
 *         item = self._from.pop()
 *         self._from.append(Join(item, dest, join_type, on))             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_from); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Join); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  __pyx_t_8 = PyTuple_New(4+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2571, __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_item);
  __Pyx_GIVEREF(__pyx_v_item);
  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_item);
  __Pyx_INCREF(__pyx_v_dest);
  __Pyx_GIVEREF(__pyx_v_dest);
  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_dest);
  __Pyx_INCREF(__pyx_v_join_type);
  __Pyx_GIVEREF(__pyx_v_join_type);
  PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_join_type);
  __Pyx_INCREF(__pyx_v_on);
  __Pyx_GIVEREF(__pyx_v_on);
  PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_on);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = __Pyx_PyObject_Append(__pyx_t_4, __pyx_t_1); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 2571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2567
 * 
 *     @Node.copy
 *     def join(self, dest, join_type='INNER', on=None):             # <<<<<<<<<<<<<<
 *         if not self._from:
 *             raise ValueError('No sources to join on.')
 */

  /* 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("sweepea.Select.join", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2574
 * 
 *     @Node.copy
 *     def where(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Select_7where(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Select_7where = {"where", (PyCFunction)__pyx_pw_7sweepea_6Select_7where, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Select_7where(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_expressions = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("where (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_expressions = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_expressions)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_expressions);
  } else {
    __pyx_v_expressions = __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, "where") < 0)) __PYX_ERR(0, 2574, __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("where", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2574, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_expressions); __pyx_v_expressions = 0;
  __Pyx_AddTraceback("sweepea.Select.where", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Select_6where(__pyx_self, __pyx_v_self, __pyx_v_expressions);

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

static PyObject *__pyx_pf_7sweepea_6Select_6where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_expressions) {
  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("where", 0);
  __Pyx_INCREF(__pyx_v_expressions);

  /* "sweepea.pyx":2575
 *     @Node.copy
 *     def where(self, *expressions):
 *         if self._where is not None:             # <<<<<<<<<<<<<<
 *             expressions = (self._where,) + expressions
 *         self._where = reduce(operator.and_, expressions)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "sweepea.pyx":2576
 *     def where(self, *expressions):
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions             # <<<<<<<<<<<<<<
 *         self._where = reduce(operator.and_, expressions)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_v_expressions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_expressions, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "sweepea.pyx":2575
 *     @Node.copy
 *     def where(self, *expressions):
 *         if self._where is not None:             # <<<<<<<<<<<<<<
 *             expressions = (self._where,) + expressions
 *         self._where = reduce(operator.and_, expressions)
 */
  }

  /* "sweepea.pyx":2577
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 *         self._where = reduce(operator.and_, expressions)             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_operator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_and); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_expressions);
  __Pyx_GIVEREF(__pyx_v_expressions);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_expressions);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_reduce, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2577, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_where_2, __pyx_t_4) < 0) __PYX_ERR(0, 2577, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2574
 * 
 *     @Node.copy
 *     def where(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 */

  /* 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_AddTraceback("sweepea.Select.where", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_expressions);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2580
 * 
 *     @Node.copy
 *     def group_by(self, *columns):             # <<<<<<<<<<<<<<
 *         self._group_by = columns
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Select_9group_by(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Select_9group_by = {"group_by", (PyCFunction)__pyx_pw_7sweepea_6Select_9group_by, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Select_9group_by(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_by (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_columns = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_columns)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_columns);
  } else {
    __pyx_v_columns = __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, "group_by") < 0)) __PYX_ERR(0, 2580, __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("group_by", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2580, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_columns); __pyx_v_columns = 0;
  __Pyx_AddTraceback("sweepea.Select.group_by", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Select_8group_by(__pyx_self, __pyx_v_self, __pyx_v_columns);

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

static PyObject *__pyx_pf_7sweepea_6Select_8group_by(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_columns) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_by", 0);

  /* "sweepea.pyx":2581
 *     @Node.copy
 *     def group_by(self, *columns):
 *         self._group_by = columns             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_group_by_2, __pyx_v_columns) < 0) __PYX_ERR(0, 2581, __pyx_L1_error)

  /* "sweepea.pyx":2580
 * 
 *     @Node.copy
 *     def group_by(self, *columns):             # <<<<<<<<<<<<<<
 *         self._group_by = columns
 * 
 */

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

/* "sweepea.pyx":2584
 * 
 *     @Node.copy
 *     def group_by_extend(self, *columns):             # <<<<<<<<<<<<<<
 *         self._group_by = ((self._group_by or ()) + columns) or None
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Select_11group_by_extend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Select_11group_by_extend = {"group_by_extend", (PyCFunction)__pyx_pw_7sweepea_6Select_11group_by_extend, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Select_11group_by_extend(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("group_by_extend (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_columns = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_columns)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_columns);
  } else {
    __pyx_v_columns = __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, "group_by_extend") < 0)) __PYX_ERR(0, 2584, __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("group_by_extend", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2584, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_columns); __pyx_v_columns = 0;
  __Pyx_AddTraceback("sweepea.Select.group_by_extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Select_10group_by_extend(__pyx_self, __pyx_v_self, __pyx_v_columns);

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

static PyObject *__pyx_pf_7sweepea_6Select_10group_by_extend(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_columns) {
  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;
  __Pyx_RefNannySetupContext("group_by_extend", 0);

  /* "sweepea.pyx":2585
 *     @Node.copy
 *     def group_by_extend(self, *columns):
 *         self._group_by = ((self._group_by or ()) + columns) or None             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_group_by_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2585, __pyx_L1_error)
  if (!__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5_bool_binop_done;
  }
  __Pyx_INCREF(__pyx_empty_tuple);
  __pyx_t_2 = __pyx_empty_tuple;
  __pyx_L5_bool_binop_done:;
  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 2585, __pyx_L1_error)
  if (!__pyx_t_4) {
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3_bool_binop_done;
  }
  __Pyx_INCREF(Py_None);
  __pyx_t_1 = Py_None;
  __pyx_L3_bool_binop_done:;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_group_by_2, __pyx_t_1) < 0) __PYX_ERR(0, 2585, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2584
 * 
 *     @Node.copy
 *     def group_by_extend(self, *columns):             # <<<<<<<<<<<<<<
 *         self._group_by = ((self._group_by or ()) + columns) or 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_AddTraceback("sweepea.Select.group_by_extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2588
 * 
 *     @Node.copy
 *     def having(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._having is not None:
 *             expressions = (self._having,) + expressions
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Select_13having(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Select_13having = {"having", (PyCFunction)__pyx_pw_7sweepea_6Select_13having, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Select_13having(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_expressions = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("having (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_expressions = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_expressions)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_expressions);
  } else {
    __pyx_v_expressions = __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, "having") < 0)) __PYX_ERR(0, 2588, __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("having", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2588, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_expressions); __pyx_v_expressions = 0;
  __Pyx_AddTraceback("sweepea.Select.having", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Select_12having(__pyx_self, __pyx_v_self, __pyx_v_expressions);

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

static PyObject *__pyx_pf_7sweepea_6Select_12having(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_expressions) {
  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("having", 0);
  __Pyx_INCREF(__pyx_v_expressions);

  /* "sweepea.pyx":2589
 *     @Node.copy
 *     def having(self, *expressions):
 *         if self._having is not None:             # <<<<<<<<<<<<<<
 *             expressions = (self._having,) + expressions
 *         self._having = reduce(operator.and_, expressions)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_having_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "sweepea.pyx":2590
 *     def having(self, *expressions):
 *         if self._having is not None:
 *             expressions = (self._having,) + expressions             # <<<<<<<<<<<<<<
 *         self._having = reduce(operator.and_, expressions)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_having_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_v_expressions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_expressions, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "sweepea.pyx":2589
 *     @Node.copy
 *     def having(self, *expressions):
 *         if self._having is not None:             # <<<<<<<<<<<<<<
 *             expressions = (self._having,) + expressions
 *         self._having = reduce(operator.and_, expressions)
 */
  }

  /* "sweepea.pyx":2591
 *         if self._having is not None:
 *             expressions = (self._having,) + expressions
 *         self._having = reduce(operator.and_, expressions)             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_operator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_and); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_expressions);
  __Pyx_GIVEREF(__pyx_v_expressions);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_expressions);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_reduce, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_having_2, __pyx_t_4) < 0) __PYX_ERR(0, 2591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2588
 * 
 *     @Node.copy
 *     def having(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._having is not None:
 *             expressions = (self._having,) + expressions
 */

  /* 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_AddTraceback("sweepea.Select.having", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_expressions);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2594
 * 
 *     @Node.copy
 *     def distinct(self, is_distinct=True):             # <<<<<<<<<<<<<<
 *         self._distinct = is_distinct
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Select_15distinct(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Select_15distinct = {"distinct", (PyCFunction)__pyx_pw_7sweepea_6Select_15distinct, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Select_15distinct(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_is_distinct = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("distinct (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_is_distinct,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_True));
    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_is_distinct);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "distinct") < 0)) __PYX_ERR(0, 2594, __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_is_distinct = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("distinct", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2594, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Select.distinct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Select_14distinct(__pyx_self, __pyx_v_self, __pyx_v_is_distinct);

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

static PyObject *__pyx_pf_7sweepea_6Select_14distinct(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_is_distinct) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("distinct", 0);

  /* "sweepea.pyx":2595
 *     @Node.copy
 *     def distinct(self, is_distinct=True):
 *         self._distinct = is_distinct             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_distinct_2, __pyx_v_is_distinct) < 0) __PYX_ERR(0, 2595, __pyx_L1_error)

  /* "sweepea.pyx":2594
 * 
 *     @Node.copy
 *     def distinct(self, is_distinct=True):             # <<<<<<<<<<<<<<
 *         self._distinct = is_distinct
 * 
 */

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

/* "sweepea.pyx":2598
 * 
 *     @Node.copy
 *     def dicts(self, as_dict=True):             # <<<<<<<<<<<<<<
 *         self._dicts = as_dict
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Select_17dicts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Select_17dicts = {"dicts", (PyCFunction)__pyx_pw_7sweepea_6Select_17dicts, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Select_17dicts(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_as_dict = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dicts (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_as_dict,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_True));
    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_as_dict);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dicts") < 0)) __PYX_ERR(0, 2598, __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_as_dict = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("dicts", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2598, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Select.dicts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Select_16dicts(__pyx_self, __pyx_v_self, __pyx_v_as_dict);

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

static PyObject *__pyx_pf_7sweepea_6Select_16dicts(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_as_dict) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("dicts", 0);

  /* "sweepea.pyx":2599
 *     @Node.copy
 *     def dicts(self, as_dict=True):
 *         self._dicts = as_dict             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_dicts, __pyx_v_as_dict) < 0) __PYX_ERR(0, 2599, __pyx_L1_error)

  /* "sweepea.pyx":2598
 * 
 *     @Node.copy
 *     def dicts(self, as_dict=True):             # <<<<<<<<<<<<<<
 *         self._dicts = as_dict
 * 
 */

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

/* "sweepea.pyx":2602
 * 
 *     @Node.copy
 *     def objects(self, as_object=True):             # <<<<<<<<<<<<<<
 *         self._objects = as_object
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Select_19objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Select_19objects = {"objects", (PyCFunction)__pyx_pw_7sweepea_6Select_19objects, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Select_19objects(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_as_object = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("objects (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_as_object,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_True));
    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_as_object);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "objects") < 0)) __PYX_ERR(0, 2602, __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_as_object = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("objects", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2602, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Select.objects", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Select_18objects(__pyx_self, __pyx_v_self, __pyx_v_as_object);

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

static PyObject *__pyx_pf_7sweepea_6Select_18objects(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_as_object) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("objects", 0);

  /* "sweepea.pyx":2603
 *     @Node.copy
 *     def objects(self, as_object=True):
 *         self._objects = as_object             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_objects, __pyx_v_as_object) < 0) __PYX_ERR(0, 2603, __pyx_L1_error)

  /* "sweepea.pyx":2602
 * 
 *     @Node.copy
 *     def objects(self, as_object=True):             # <<<<<<<<<<<<<<
 *         self._objects = as_object
 * 
 */

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

/* "sweepea.pyx":2605
 *         self._objects = as_object
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         super(Select, self).__sql__(ctx)
 *         is_subquery = ctx.subquery
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Select_21__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Select_21__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_6Select_21__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Select_21__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2605, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2605, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2605, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Select.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2605, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Select_20__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_6Select_20__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_v_is_subquery = NULL;
  PyObject *__pyx_v_parentheses = 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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_t_16;
  PyObject *__pyx_t_17 = NULL;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2606
 * 
 *     def __sql__(self, Context ctx):
 *         super(Select, self).__sql__(ctx)             # <<<<<<<<<<<<<<
 *         is_subquery = ctx.subquery
 *         parentheses = is_subquery or (ctx.scope == SCOPE_SOURCE)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Select); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sql_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_ctx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_ctx));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2606, __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;

  /* "sweepea.pyx":2607
 *     def __sql__(self, Context ctx):
 *         super(Select, self).__sql__(ctx)
 *         is_subquery = ctx.subquery             # <<<<<<<<<<<<<<
 *         parentheses = is_subquery or (ctx.scope == SCOPE_SOURCE)
 *         with ctx.scope_normal(parentheses=parentheses, subquery=True):
 */
  __pyx_t_1 = __pyx_v_ctx->subquery;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_is_subquery = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":2608
 *         super(Select, self).__sql__(ctx)
 *         is_subquery = ctx.subquery
 *         parentheses = is_subquery or (ctx.scope == SCOPE_SOURCE)             # <<<<<<<<<<<<<<
 *         with ctx.scope_normal(parentheses=parentheses, subquery=True):
 *             ctx.literal('SELECT DISTINCT ' if self._distinct else 'SELECT ')
 */
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_v_is_subquery); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2608, __pyx_L1_error)
  if (!__pyx_t_5) {
  } else {
    __Pyx_INCREF(__pyx_v_is_subquery);
    __pyx_t_1 = __pyx_v_is_subquery;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ctx->scope); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCOPE_SOURCE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2608, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2608, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_t_1 = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_parentheses = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":2609
 *         is_subquery = ctx.subquery
 *         parentheses = is_subquery or (ctx.scope == SCOPE_SOURCE)
 *         with ctx.scope_normal(parentheses=parentheses, subquery=True):             # <<<<<<<<<<<<<<
 *             ctx.literal('SELECT DISTINCT ' if self._distinct else 'SELECT ')
 *             with ctx.scope_source():
 */
  /*with:*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ctx), __pyx_n_s_scope_normal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_parentheses, __pyx_v_parentheses) < 0) __PYX_ERR(0, 2609, __pyx_L1_error)
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_subquery, Py_True) < 0) __PYX_ERR(0, 2609, __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, 2609, __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_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2609, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2609, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2609, __pyx_L5_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __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;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_9);
        /*try:*/ {

          /* "sweepea.pyx":2610
 *         parentheses = is_subquery or (ctx.scope == SCOPE_SOURCE)
 *         with ctx.scope_normal(parentheses=parentheses, subquery=True):
 *             ctx.literal('SELECT DISTINCT ' if self._distinct else 'SELECT ')             # <<<<<<<<<<<<<<
 *             with ctx.scope_source():
 *                 ctx.sql(CommaList(self._columns))
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_distinct_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2610, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 2610, __pyx_L9_error)
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (__pyx_t_5) {
            __Pyx_INCREF(__pyx_kp_s_SELECT_DISTINCT);
            __pyx_t_4 = __pyx_kp_s_SELECT_DISTINCT;
          } else {
            __Pyx_INCREF(__pyx_kp_s_SELECT);
            __pyx_t_4 = __pyx_kp_s_SELECT;
          }
          __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_t_4, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2610, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "sweepea.pyx":2611
 *         with ctx.scope_normal(parentheses=parentheses, subquery=True):
 *             ctx.literal('SELECT DISTINCT ' if self._distinct else 'SELECT ')
 *             with ctx.scope_source():             # <<<<<<<<<<<<<<
 *                 ctx.sql(CommaList(self._columns))
 * 
 */
          /*with:*/ {
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ctx), __pyx_n_s_scope_source); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2611, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_1 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_1)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            if (__pyx_t_1) {
              __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2611, __pyx_L9_error)
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            } else {
              __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2611, __pyx_L9_error)
            }
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2611, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_10);
            __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_2, __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2611, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
              if (likely(__pyx_t_3)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
                __Pyx_INCREF(__pyx_t_3);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_1, function);
              }
            }
            if (__pyx_t_3) {
              __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2611, __pyx_L17_error)
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            } else {
              __pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2611, __pyx_L17_error)
            }
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            /*try:*/ {
              {
                __Pyx_PyThreadState_declare
                __Pyx_PyThreadState_assign
                __Pyx_ExceptionSave(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
                __Pyx_XGOTREF(__pyx_t_11);
                __Pyx_XGOTREF(__pyx_t_12);
                __Pyx_XGOTREF(__pyx_t_13);
                /*try:*/ {

                  /* "sweepea.pyx":2612
 *             ctx.literal('SELECT DISTINCT ' if self._distinct else 'SELECT ')
 *             with ctx.scope_source():
 *                 ctx.sql(CommaList(self._columns))             # <<<<<<<<<<<<<<
 * 
 *             if self._from:
 */
                  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_CommaList); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2612, __pyx_L23_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_columns_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2612, __pyx_L23_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_3 = NULL;
                  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
                    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
                    if (likely(__pyx_t_3)) {
                      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                      __Pyx_INCREF(__pyx_t_3);
                      __Pyx_INCREF(function);
                      __Pyx_DECREF_SET(__pyx_t_4, function);
                    }
                  }
                  if (!__pyx_t_3) {
                    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2612, __pyx_L23_error)
                    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                    __Pyx_GOTREF(__pyx_t_2);
                  } else {
                    __pyx_t_14 = PyTuple_New(1+1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2612, __pyx_L23_error)
                    __Pyx_GOTREF(__pyx_t_14);
                    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_3); __pyx_t_3 = NULL;
                    __Pyx_GIVEREF(__pyx_t_1);
                    PyTuple_SET_ITEM(__pyx_t_14, 0+1, __pyx_t_1);
                    __pyx_t_1 = 0;
                    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2612, __pyx_L23_error)
                    __Pyx_GOTREF(__pyx_t_2);
                    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  }
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_2, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2612, __pyx_L23_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

                  /* "sweepea.pyx":2611
 *         with ctx.scope_normal(parentheses=parentheses, subquery=True):
 *             ctx.literal('SELECT DISTINCT ' if self._distinct else 'SELECT ')
 *             with ctx.scope_source():             # <<<<<<<<<<<<<<
 *                 ctx.sql(CommaList(self._columns))
 * 
 */
                }
                __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                goto __pyx_L30_try_end;
                __pyx_L23_error:;
                __Pyx_PyThreadState_assign
                __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                /*except:*/ {
                  __Pyx_AddTraceback("sweepea.Select.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_2, &__pyx_t_14) < 0) __PYX_ERR(0, 2611, __pyx_L25_except_error)
                  __Pyx_GOTREF(__pyx_t_4);
                  __Pyx_GOTREF(__pyx_t_2);
                  __Pyx_GOTREF(__pyx_t_14);
                  __pyx_t_1 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_2, __pyx_t_14); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2611, __pyx_L25_except_error)
                  __Pyx_GOTREF(__pyx_t_1);
                  __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_1, NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                  if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2611, __pyx_L25_except_error)
                  __Pyx_GOTREF(__pyx_t_15);
                  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_15);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                  if (__pyx_t_5 < 0) __PYX_ERR(0, 2611, __pyx_L25_except_error)
                  __pyx_t_16 = ((!(__pyx_t_5 != 0)) != 0);
                  if (__pyx_t_16) {
                    __Pyx_GIVEREF(__pyx_t_4);
                    __Pyx_GIVEREF(__pyx_t_2);
                    __Pyx_XGIVEREF(__pyx_t_14);
                    __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_2, __pyx_t_14);
                    __pyx_t_4 = 0; __pyx_t_2 = 0; __pyx_t_14 = 0; 
                    __PYX_ERR(0, 2611, __pyx_L25_except_error)
                  }
                  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                  goto __pyx_L24_exception_handled;
                }
                __pyx_L25_except_error:;
                __Pyx_PyThreadState_assign
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
                goto __pyx_L9_error;
                __pyx_L24_exception_handled:;
                __Pyx_PyThreadState_assign
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_XGIVEREF(__pyx_t_13);
                __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
                __pyx_L30_try_end:;
              }
            }
            /*finally:*/ {
              /*normal exit:*/{
                if (__pyx_t_10) {
                  __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__78, NULL);
                  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                  if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2611, __pyx_L9_error)
                  __Pyx_GOTREF(__pyx_t_13);
                  __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
                }
                goto __pyx_L22;
              }
              __pyx_L22:;
            }
            goto __pyx_L34;
            __pyx_L17_error:;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            goto __pyx_L9_error;
            __pyx_L34:;
          }

          /* "sweepea.pyx":2614
 *                 ctx.sql(CommaList(self._columns))
 * 
 *             if self._from:             # <<<<<<<<<<<<<<
 *                 with ctx.scope_source(parentheses=False):
 *                     ctx.literal(' FROM ').sql(CommaList(self._from))
 */
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_from); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2614, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 2614, __pyx_L9_error)
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (__pyx_t_16) {

            /* "sweepea.pyx":2615
 * 
 *             if self._from:
 *                 with ctx.scope_source(parentheses=False):             # <<<<<<<<<<<<<<
 *                     ctx.literal(' FROM ').sql(CommaList(self._from))
 * 
 */
            /*with:*/ {
              __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ctx), __pyx_n_s_scope_source); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2615, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2615, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_2);
              if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_parentheses, Py_False) < 0) __PYX_ERR(0, 2615, __pyx_L9_error)
              __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2615, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __pyx_t_10 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2615, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_10);
              __pyx_t_14 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2615, __pyx_L36_error)
              __Pyx_GOTREF(__pyx_t_14);
              __pyx_t_1 = NULL;
              if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_14))) {
                __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_14);
                if (likely(__pyx_t_1)) {
                  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
                  __Pyx_INCREF(__pyx_t_1);
                  __Pyx_INCREF(function);
                  __Pyx_DECREF_SET(__pyx_t_14, function);
                }
              }
              if (__pyx_t_1) {
                __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2615, __pyx_L36_error)
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              } else {
                __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_14); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2615, __pyx_L36_error)
              }
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              /*try:*/ {
                {
                  __Pyx_PyThreadState_declare
                  __Pyx_PyThreadState_assign
                  __Pyx_ExceptionSave(&__pyx_t_13, &__pyx_t_12, &__pyx_t_11);
                  __Pyx_XGOTREF(__pyx_t_13);
                  __Pyx_XGOTREF(__pyx_t_12);
                  __Pyx_XGOTREF(__pyx_t_11);
                  /*try:*/ {

                    /* "sweepea.pyx":2616
 *             if self._from:
 *                 with ctx.scope_source(parentheses=False):
 *                     ctx.literal(' FROM ').sql(CommaList(self._from))             # <<<<<<<<<<<<<<
 * 
 *             if self._where is not None:
 */
                    __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_FROM, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2616, __pyx_L42_error)
                    __Pyx_GOTREF(__pyx_t_4);
                    __pyx_t_14 = __Pyx_GetModuleGlobalName(__pyx_n_s_CommaList); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2616, __pyx_L42_error)
                    __Pyx_GOTREF(__pyx_t_14);
                    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_from); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2616, __pyx_L42_error)
                    __Pyx_GOTREF(__pyx_t_1);
                    __pyx_t_3 = NULL;
                    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_14))) {
                      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_14);
                      if (likely(__pyx_t_3)) {
                        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_14);
                        __Pyx_INCREF(__pyx_t_3);
                        __Pyx_INCREF(function);
                        __Pyx_DECREF_SET(__pyx_t_14, function);
                      }
                    }
                    if (!__pyx_t_3) {
                      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_14, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2616, __pyx_L42_error)
                      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                      __Pyx_GOTREF(__pyx_t_2);
                    } else {
                      __pyx_t_17 = PyTuple_New(1+1); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2616, __pyx_L42_error)
                      __Pyx_GOTREF(__pyx_t_17);
                      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_3); __pyx_t_3 = NULL;
                      __Pyx_GIVEREF(__pyx_t_1);
                      PyTuple_SET_ITEM(__pyx_t_17, 0+1, __pyx_t_1);
                      __pyx_t_1 = 0;
                      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_17, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2616, __pyx_L42_error)
                      __Pyx_GOTREF(__pyx_t_2);
                      __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                    }
                    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                    __pyx_t_14 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_4)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_4), __pyx_t_2, 0)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2616, __pyx_L42_error)
                    __Pyx_GOTREF(__pyx_t_14);
                    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

                    /* "sweepea.pyx":2615
 * 
 *             if self._from:
 *                 with ctx.scope_source(parentheses=False):             # <<<<<<<<<<<<<<
 *                     ctx.literal(' FROM ').sql(CommaList(self._from))
 * 
 */
                  }
                  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
                  goto __pyx_L49_try_end;
                  __pyx_L42_error:;
                  __Pyx_PyThreadState_assign
                  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                  __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                  /*except:*/ {
                    __Pyx_AddTraceback("sweepea.Select.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
                    if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_2, &__pyx_t_4) < 0) __PYX_ERR(0, 2615, __pyx_L44_except_error)
                    __Pyx_GOTREF(__pyx_t_14);
                    __Pyx_GOTREF(__pyx_t_2);
                    __Pyx_GOTREF(__pyx_t_4);
                    __pyx_t_17 = PyTuple_Pack(3, __pyx_t_14, __pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2615, __pyx_L44_except_error)
                    __Pyx_GOTREF(__pyx_t_17);
                    __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_17, NULL);
                    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
                    if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2615, __pyx_L44_except_error)
                    __Pyx_GOTREF(__pyx_t_15);
                    __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_15);
                    __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                    if (__pyx_t_16 < 0) __PYX_ERR(0, 2615, __pyx_L44_except_error)
                    __pyx_t_5 = ((!(__pyx_t_16 != 0)) != 0);
                    if (__pyx_t_5) {
                      __Pyx_GIVEREF(__pyx_t_14);
                      __Pyx_GIVEREF(__pyx_t_2);
                      __Pyx_XGIVEREF(__pyx_t_4);
                      __Pyx_ErrRestoreWithState(__pyx_t_14, __pyx_t_2, __pyx_t_4);
                      __pyx_t_14 = 0; __pyx_t_2 = 0; __pyx_t_4 = 0; 
                      __PYX_ERR(0, 2615, __pyx_L44_except_error)
                    }
                    __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
                    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                    goto __pyx_L43_exception_handled;
                  }
                  __pyx_L44_except_error:;
                  __Pyx_PyThreadState_assign
                  __Pyx_XGIVEREF(__pyx_t_13);
                  __Pyx_XGIVEREF(__pyx_t_12);
                  __Pyx_XGIVEREF(__pyx_t_11);
                  __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
                  goto __pyx_L9_error;
                  __pyx_L43_exception_handled:;
                  __Pyx_PyThreadState_assign
                  __Pyx_XGIVEREF(__pyx_t_13);
                  __Pyx_XGIVEREF(__pyx_t_12);
                  __Pyx_XGIVEREF(__pyx_t_11);
                  __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_12, __pyx_t_11);
                  __pyx_L49_try_end:;
                }
              }
              /*finally:*/ {
                /*normal exit:*/{
                  if (__pyx_t_10) {
                    __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_tuple__79, NULL);
                    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
                    if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2615, __pyx_L9_error)
                    __Pyx_GOTREF(__pyx_t_11);
                    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
                  }
                  goto __pyx_L41;
                }
                __pyx_L41:;
              }
              goto __pyx_L53;
              __pyx_L36_error:;
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              goto __pyx_L9_error;
              __pyx_L53:;
            }

            /* "sweepea.pyx":2614
 *                 ctx.sql(CommaList(self._columns))
 * 
 *             if self._from:             # <<<<<<<<<<<<<<
 *                 with ctx.scope_source(parentheses=False):
 *                     ctx.literal(' FROM ').sql(CommaList(self._from))
 */
          }

          /* "sweepea.pyx":2618
 *                     ctx.literal(' FROM ').sql(CommaList(self._from))
 * 
 *             if self._where is not None:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' WHERE ').sql(self._where)
 * 
 */
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2618, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = (__pyx_t_4 != Py_None);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_16 = (__pyx_t_5 != 0);
          if (__pyx_t_16) {

            /* "sweepea.pyx":2619
 * 
 *             if self._where is not None:
 *                 ctx.literal(' WHERE ').sql(self._where)             # <<<<<<<<<<<<<<
 * 
 *             if self._group_by:
 */
            __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_WHERE, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2619, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2619, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_14 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_4)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_4), __pyx_t_2, 0)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2619, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

            /* "sweepea.pyx":2618
 *                     ctx.literal(' FROM ').sql(CommaList(self._from))
 * 
 *             if self._where is not None:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' WHERE ').sql(self._where)
 * 
 */
          }

          /* "sweepea.pyx":2621
 *                 ctx.literal(' WHERE ').sql(self._where)
 * 
 *             if self._group_by:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' GROUP BY ').sql(CommaList(self._group_by))
 * 
 */
          __pyx_t_14 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_group_by_2); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2621, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_14);
          __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_14); if (unlikely(__pyx_t_16 < 0)) __PYX_ERR(0, 2621, __pyx_L9_error)
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (__pyx_t_16) {

            /* "sweepea.pyx":2622
 * 
 *             if self._group_by:
 *                 ctx.literal(' GROUP BY ').sql(CommaList(self._group_by))             # <<<<<<<<<<<<<<
 * 
 *             if self._having is not None:
 */
            __pyx_t_14 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_GROUP_BY, 0)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2622, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_14);
            __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_CommaList); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2622, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_group_by_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 2622, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_17);
            __pyx_t_1 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_1)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            if (!__pyx_t_1) {
              __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_17); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2622, __pyx_L9_error)
              __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
              __Pyx_GOTREF(__pyx_t_2);
            } else {
              __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2622, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
              __Pyx_GIVEREF(__pyx_t_17);
              PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_17);
              __pyx_t_17 = 0;
              __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2622, __pyx_L9_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_14)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_14), __pyx_t_2, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2622, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "sweepea.pyx":2621
 *                 ctx.literal(' WHERE ').sql(self._where)
 * 
 *             if self._group_by:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' GROUP BY ').sql(CommaList(self._group_by))
 * 
 */
          }

          /* "sweepea.pyx":2624
 *                 ctx.literal(' GROUP BY ').sql(CommaList(self._group_by))
 * 
 *             if self._having is not None:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' HAVING ').sql(self._having)
 * 
 */
          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_having_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2624, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_16 = (__pyx_t_4 != Py_None);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_5 = (__pyx_t_16 != 0);
          if (__pyx_t_5) {

            /* "sweepea.pyx":2625
 * 
 *             if self._having is not None:
 *                 ctx.literal(' HAVING ').sql(self._having)             # <<<<<<<<<<<<<<
 * 
 *             self.apply_ordering(ctx)
 */
            __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_HAVING, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2625, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_having_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2625, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_14 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_4)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_4), __pyx_t_2, 0)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2625, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

            /* "sweepea.pyx":2624
 *                 ctx.literal(' GROUP BY ').sql(CommaList(self._group_by))
 * 
 *             if self._having is not None:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' HAVING ').sql(self._having)
 * 
 */
          }

          /* "sweepea.pyx":2627
 *                 ctx.literal(' HAVING ').sql(self._having)
 * 
 *             self.apply_ordering(ctx)             # <<<<<<<<<<<<<<
 * 
 *         return self.apply_alias(ctx)
 */
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_apply_ordering); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2627, __pyx_L9_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_4 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_4)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          if (!__pyx_t_4) {
            __pyx_t_14 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_ctx)); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2627, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_14);
          } else {
            __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2627, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
            __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
            PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_ctx));
            __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2627, __pyx_L9_error)
            __Pyx_GOTREF(__pyx_t_14);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;

          /* "sweepea.pyx":2609
 *         is_subquery = ctx.subquery
 *         parentheses = is_subquery or (ctx.scope == SCOPE_SOURCE)
 *         with ctx.scope_normal(parentheses=parentheses, subquery=True):             # <<<<<<<<<<<<<<
 *             ctx.literal('SELECT DISTINCT ' if self._distinct else 'SELECT ')
 *             with ctx.scope_source():
 */
        }
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L16_try_end;
        __pyx_L9_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_17); __pyx_t_17 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("sweepea.Select.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_14, &__pyx_t_2, &__pyx_t_3) < 0) __PYX_ERR(0, 2609, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_14);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = PyTuple_Pack(3, __pyx_t_14, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2609, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2609, __pyx_L11_except_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          if (__pyx_t_5 < 0) __PYX_ERR(0, 2609, __pyx_L11_except_error)
          __pyx_t_16 = ((!(__pyx_t_5 != 0)) != 0);
          if (__pyx_t_16) {
            __Pyx_GIVEREF(__pyx_t_14);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_3);
            __Pyx_ErrRestoreWithState(__pyx_t_14, __pyx_t_2, __pyx_t_3);
            __pyx_t_14 = 0; __pyx_t_2 = 0; __pyx_t_3 = 0; 
            __PYX_ERR(0, 2609, __pyx_L11_except_error)
          }
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          goto __pyx_L10_exception_handled;
        }
        __pyx_L11_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        goto __pyx_L1_error;
        __pyx_L10_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_XGIVEREF(__pyx_t_9);
        __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
        __pyx_L16_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_6) {
          __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__80, NULL);
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2609, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        goto __pyx_L8;
      }
      __pyx_L8:;
    }
    goto __pyx_L60;
    __pyx_L5_error:;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L1_error;
    __pyx_L60:;
  }

  /* "sweepea.pyx":2629
 *             self.apply_ordering(ctx)
 * 
 *         return self.apply_alias(ctx)             # <<<<<<<<<<<<<<
 * 
 *     def execute(self, Database database):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_apply_alias); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2629, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_14 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_14)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_14);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_14) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_ctx)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_14); __pyx_t_14 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_ctx));
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2605
 *         self._objects = as_object
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         super(Select, self).__sql__(ctx)
 *         is_subquery = ctx.subquery
 */

  /* 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_14);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_AddTraceback("sweepea.Select.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_is_subquery);
  __Pyx_XDECREF(__pyx_v_parentheses);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2631
 *         return self.apply_alias(ctx)
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         cursor = database.execute(self)
 *         if self._dicts:
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Select_23execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Select_23execute = {"execute", (PyCFunction)__pyx_pw_7sweepea_6Select_23execute, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Select_23execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Database *__pyx_v_database = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_database,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_database)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, 1); __PYX_ERR(0, 2631, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute") < 0)) __PYX_ERR(0, 2631, __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_database = ((struct __pyx_obj_7sweepea_Database *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2631, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Select.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_database), __pyx_ptype_7sweepea_Database, 1, "database", 0))) __PYX_ERR(0, 2631, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Select_22execute(__pyx_self, __pyx_v_self, __pyx_v_database);

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

static PyObject *__pyx_pf_7sweepea_6Select_22execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_database) {
  PyObject *__pyx_v_cursor = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("execute", 0);

  /* "sweepea.pyx":2632
 * 
 *     def execute(self, Database database):
 *         cursor = database.execute(self)             # <<<<<<<<<<<<<<
 *         if self._dicts:
 *             return DictCursorWrapper(cursor)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_database->__pyx_vtab)->execute(__pyx_v_database, __pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2632, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_cursor = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "sweepea.pyx":2633
 *     def execute(self, Database database):
 *         cursor = database.execute(self)
 *         if self._dicts:             # <<<<<<<<<<<<<<
 *             return DictCursorWrapper(cursor)
 *         elif self._objects:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dicts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2633, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "sweepea.pyx":2634
 *         cursor = database.execute(self)
 *         if self._dicts:
 *             return DictCursorWrapper(cursor)             # <<<<<<<<<<<<<<
 *         elif self._objects:
 *             return NamedTupleCursorWrapper(cursor)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_DictCursorWrapper); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_cursor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
    } else {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2634, __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_cursor);
      __Pyx_GIVEREF(__pyx_v_cursor);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_cursor);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "sweepea.pyx":2633
 *     def execute(self, Database database):
 *         cursor = database.execute(self)
 *         if self._dicts:             # <<<<<<<<<<<<<<
 *             return DictCursorWrapper(cursor)
 *         elif self._objects:
 */
  }

  /* "sweepea.pyx":2635
 *         if self._dicts:
 *             return DictCursorWrapper(cursor)
 *         elif self._objects:             # <<<<<<<<<<<<<<
 *             return NamedTupleCursorWrapper(cursor)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 2635, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "sweepea.pyx":2636
 *             return DictCursorWrapper(cursor)
 *         elif self._objects:
 *             return NamedTupleCursorWrapper(cursor)             # <<<<<<<<<<<<<<
 *         else:
 *             return CursorWrapper(cursor)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_cursor);
    __Pyx_GIVEREF(__pyx_v_cursor);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_cursor);
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea_NamedTupleCursorWrapper), __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "sweepea.pyx":2635
 *         if self._dicts:
 *             return DictCursorWrapper(cursor)
 *         elif self._objects:             # <<<<<<<<<<<<<<
 *             return NamedTupleCursorWrapper(cursor)
 *         else:
 */
  }

  /* "sweepea.pyx":2638
 *             return NamedTupleCursorWrapper(cursor)
 *         else:
 *             return CursorWrapper(cursor)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_cursor);
    __Pyx_GIVEREF(__pyx_v_cursor);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_cursor);
    __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea_CursorWrapper), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "sweepea.pyx":2631
 *         return self.apply_alias(ctx)
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         cursor = database.execute(self)
 *         if self._dicts:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea.Select.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_cursor);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2642
 * 
 * class WriteQuery(Query):
 *     def __init__(self, table, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         super(WriteQuery, self).__init__(*args, **kwargs)
 *         self.table = table
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_10WriteQuery_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_10WriteQuery_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_10WriteQuery_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_10WriteQuery_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_table = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_table,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) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        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;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, 1); __PYX_ERR(0, 2642, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "__init__") < 0)) __PYX_ERR(0, 2642, __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_table = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2642, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("sweepea.WriteQuery.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_10WriteQuery___init__(__pyx_self, __pyx_v_self, __pyx_v_table, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7sweepea_10WriteQuery___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_table, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "sweepea.pyx":2643
 * class WriteQuery(Query):
 *     def __init__(self, table, *args, **kwargs):
 *         super(WriteQuery, self).__init__(*args, **kwargs)             # <<<<<<<<<<<<<<
 *         self.table = table
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_WriteQuery); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2643, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2643, __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_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2643, __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;

  /* "sweepea.pyx":2644
 *     def __init__(self, table, *args, **kwargs):
 *         super(WriteQuery, self).__init__(*args, **kwargs)
 *         self.table = table             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_table, __pyx_v_table) < 0) __PYX_ERR(0, 2644, __pyx_L1_error)

  /* "sweepea.pyx":2642
 * 
 * class WriteQuery(Query):
 *     def __init__(self, table, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         super(WriteQuery, self).__init__(*args, **kwargs)
 *         self.table = table
 */

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

/* "sweepea.pyx":2648
 * 
 * class Update(WriteQuery):
 *     def __init__(self, table, data=None, where=None, order_by=None, limit=None,             # <<<<<<<<<<<<<<
 *                  offset=None, on_conflict=None):
 *         super(Update, self).__init__(table, order_by=order_by, limit=limit,
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Update_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Update_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_6Update_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Update_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_table = 0;
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_where = 0;
  PyObject *__pyx_v_order_by = 0;
  PyObject *__pyx_v_limit = 0;
  PyObject *__pyx_v_offset = 0;
  PyObject *__pyx_v_on_conflict = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_table,&__pyx_n_s_data,&__pyx_n_s_where,&__pyx_n_s_order_by,&__pyx_n_s_limit,&__pyx_n_s_offset,&__pyx_n_s_on_conflict,0};
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    values[5] = ((PyObject *)((PyObject *)Py_None));

    /* "sweepea.pyx":2649
 * class Update(WriteQuery):
 *     def __init__(self, table, data=None, where=None, order_by=None, limit=None,
 *                  offset=None, on_conflict=None):             # <<<<<<<<<<<<<<
 *         super(Update, self).__init__(table, order_by=order_by, limit=limit,
 *                                      offset=offset)
 */
    values[6] = ((PyObject *)((PyObject *)Py_None));
    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_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_table)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 8, 1); __PYX_ERR(0, 2648, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_where);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_order_by);
          if (value) { values[4] = value; kw_args--; }
        }
        case  5:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_limit);
          if (value) { values[5] = value; kw_args--; }
        }
        case  6:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_offset);
          if (value) { values[6] = value; kw_args--; }
        }
        case  7:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_on_conflict);
          if (value) { values[7] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2648, __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_self = values[0];
    __pyx_v_table = values[1];
    __pyx_v_data = values[2];
    __pyx_v_where = values[3];
    __pyx_v_order_by = values[4];
    __pyx_v_limit = values[5];
    __pyx_v_offset = values[6];
    __pyx_v_on_conflict = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2648, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Update.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Update___init__(__pyx_self, __pyx_v_self, __pyx_v_table, __pyx_v_data, __pyx_v_where, __pyx_v_order_by, __pyx_v_limit, __pyx_v_offset, __pyx_v_on_conflict);

  /* "sweepea.pyx":2648
 * 
 * class Update(WriteQuery):
 *     def __init__(self, table, data=None, where=None, order_by=None, limit=None,             # <<<<<<<<<<<<<<
 *                  offset=None, on_conflict=None):
 *         super(Update, self).__init__(table, order_by=order_by, limit=limit,
 */

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

static PyObject *__pyx_pf_7sweepea_6Update___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_table, PyObject *__pyx_v_data, PyObject *__pyx_v_where, PyObject *__pyx_v_order_by, PyObject *__pyx_v_limit, PyObject *__pyx_v_offset, PyObject *__pyx_v_on_conflict) {
  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("__init__", 0);

  /* "sweepea.pyx":2650
 *     def __init__(self, table, data=None, where=None, order_by=None, limit=None,
 *                  offset=None, on_conflict=None):
 *         super(Update, self).__init__(table, order_by=order_by, limit=limit,             # <<<<<<<<<<<<<<
 *                                      offset=offset)
 *         self.data = data
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Update); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_table);
  __Pyx_GIVEREF(__pyx_v_table);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_table);
  __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_order_by, __pyx_v_order_by) < 0) __PYX_ERR(0, 2650, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_limit, __pyx_v_limit) < 0) __PYX_ERR(0, 2650, __pyx_L1_error)

  /* "sweepea.pyx":2651
 *                  offset=None, on_conflict=None):
 *         super(Update, self).__init__(table, order_by=order_by, limit=limit,
 *                                      offset=offset)             # <<<<<<<<<<<<<<
 *         self.data = data
 *         self._where = where
 */
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_offset, __pyx_v_offset) < 0) __PYX_ERR(0, 2650, __pyx_L1_error)

  /* "sweepea.pyx":2650
 *     def __init__(self, table, data=None, where=None, order_by=None, limit=None,
 *                  offset=None, on_conflict=None):
 *         super(Update, self).__init__(table, order_by=order_by, limit=limit,             # <<<<<<<<<<<<<<
 *                                      offset=offset)
 *         self.data = data
 */
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2652
 *         super(Update, self).__init__(table, order_by=order_by, limit=limit,
 *                                      offset=offset)
 *         self.data = data             # <<<<<<<<<<<<<<
 *         self._where = where
 *         self._on_conflict = on_conflict
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_data, __pyx_v_data) < 0) __PYX_ERR(0, 2652, __pyx_L1_error)

  /* "sweepea.pyx":2653
 *                                      offset=offset)
 *         self.data = data
 *         self._where = where             # <<<<<<<<<<<<<<
 *         self._on_conflict = on_conflict
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_where_2, __pyx_v_where) < 0) __PYX_ERR(0, 2653, __pyx_L1_error)

  /* "sweepea.pyx":2654
 *         self.data = data
 *         self._where = where
 *         self._on_conflict = on_conflict             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_on_conflict_2, __pyx_v_on_conflict) < 0) __PYX_ERR(0, 2654, __pyx_L1_error)

  /* "sweepea.pyx":2648
 * 
 * class Update(WriteQuery):
 *     def __init__(self, table, data=None, where=None, order_by=None, limit=None,             # <<<<<<<<<<<<<<
 *                  offset=None, on_conflict=None):
 *         super(Update, self).__init__(table, order_by=order_by, limit=limit,
 */

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

/* "sweepea.pyx":2657
 * 
 *     @Node.copy
 *     def where(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Update_3where(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Update_3where = {"where", (PyCFunction)__pyx_pw_7sweepea_6Update_3where, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Update_3where(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_expressions = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("where (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_expressions = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_expressions)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_expressions);
  } else {
    __pyx_v_expressions = __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, "where") < 0)) __PYX_ERR(0, 2657, __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("where", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2657, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_expressions); __pyx_v_expressions = 0;
  __Pyx_AddTraceback("sweepea.Update.where", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Update_2where(__pyx_self, __pyx_v_self, __pyx_v_expressions);

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

static PyObject *__pyx_pf_7sweepea_6Update_2where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_expressions) {
  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("where", 0);
  __Pyx_INCREF(__pyx_v_expressions);

  /* "sweepea.pyx":2658
 *     @Node.copy
 *     def where(self, *expressions):
 *         if self._where is not None:             # <<<<<<<<<<<<<<
 *             expressions = (self._where,) + expressions
 *         self._where = reduce(operator.and_, expressions)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "sweepea.pyx":2659
 *     def where(self, *expressions):
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions             # <<<<<<<<<<<<<<
 *         self._where = reduce(operator.and_, expressions)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_v_expressions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_expressions, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "sweepea.pyx":2658
 *     @Node.copy
 *     def where(self, *expressions):
 *         if self._where is not None:             # <<<<<<<<<<<<<<
 *             expressions = (self._where,) + expressions
 *         self._where = reduce(operator.and_, expressions)
 */
  }

  /* "sweepea.pyx":2660
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 *         self._where = reduce(operator.and_, expressions)             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_operator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_and); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_expressions);
  __Pyx_GIVEREF(__pyx_v_expressions);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_expressions);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_reduce, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_where_2, __pyx_t_4) < 0) __PYX_ERR(0, 2660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2657
 * 
 *     @Node.copy
 *     def where(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 */

  /* 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_AddTraceback("sweepea.Update.where", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_expressions);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2663
 * 
 *     @Node.copy
 *     def on_conflict(self, on_conflict):             # <<<<<<<<<<<<<<
 *         self._on_conflict = on_conflict
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Update_5on_conflict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Update_5on_conflict = {"on_conflict", (PyCFunction)__pyx_pw_7sweepea_6Update_5on_conflict, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Update_5on_conflict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_on_conflict = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_conflict (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_on_conflict,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_on_conflict)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("on_conflict", 1, 2, 2, 1); __PYX_ERR(0, 2663, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "on_conflict") < 0)) __PYX_ERR(0, 2663, __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_on_conflict = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("on_conflict", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2663, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Update.on_conflict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Update_4on_conflict(__pyx_self, __pyx_v_self, __pyx_v_on_conflict);

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

static PyObject *__pyx_pf_7sweepea_6Update_4on_conflict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_on_conflict) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_conflict", 0);

  /* "sweepea.pyx":2664
 *     @Node.copy
 *     def on_conflict(self, on_conflict):
 *         self._on_conflict = on_conflict             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_on_conflict_2, __pyx_v_on_conflict) < 0) __PYX_ERR(0, 2664, __pyx_L1_error)

  /* "sweepea.pyx":2663
 * 
 *     @Node.copy
 *     def on_conflict(self, on_conflict):             # <<<<<<<<<<<<<<
 *         self._on_conflict = on_conflict
 * 
 */

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

/* "sweepea.pyx":2666
 *         self._on_conflict = on_conflict
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         with ctx.scope_values(subquery=True):
 *             ctx.literal('UPDATE ')
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Update_7__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Update_7__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_6Update_7__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Update_7__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2666, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2666, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2666, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Update.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2666, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Update_6__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_6Update_6__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  Py_ssize_t __pyx_t_13;
  PyObject *(*__pyx_t_14)(PyObject *);
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *(*__pyx_t_17)(PyObject *);
  PyObject *__pyx_t_18 = NULL;
  int __pyx_t_19;
  PyObject *__pyx_t_20 = NULL;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2667
 * 
 *     def __sql__(self, Context ctx):
 *         with ctx.scope_values(subquery=True):             # <<<<<<<<<<<<<<
 *             ctx.literal('UPDATE ')
 *             if self._on_conflict:
 */
  /*with:*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ctx), __pyx_n_s_scope_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_subquery, Py_True) < 0) __PYX_ERR(0, 2667, __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, 2667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_3, __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2667, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_5) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2667, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_2);
    __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;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "sweepea.pyx":2668
 *     def __sql__(self, Context ctx):
 *         with ctx.scope_values(subquery=True):
 *             ctx.literal('UPDATE ')             # <<<<<<<<<<<<<<
 *             if self._on_conflict:
 *                 ctx.literal('OR %s ' % self._on_conflict)
 */
          __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_UPDATE_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2668, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "sweepea.pyx":2669
 *         with ctx.scope_values(subquery=True):
 *             ctx.literal('UPDATE ')
 *             if self._on_conflict:             # <<<<<<<<<<<<<<
 *                 ctx.literal('OR %s ' % self._on_conflict)
 * 
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_conflict_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2669, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2669, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (__pyx_t_9) {

            /* "sweepea.pyx":2670
 *             ctx.literal('UPDATE ')
 *             if self._on_conflict:
 *                 ctx.literal('OR %s ' % self._on_conflict)             # <<<<<<<<<<<<<<
 * 
 *             (ctx
 */
            __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_conflict_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2670, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_OR_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2670, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2670, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

            /* "sweepea.pyx":2669
 *         with ctx.scope_values(subquery=True):
 *             ctx.literal('UPDATE ')
 *             if self._on_conflict:             # <<<<<<<<<<<<<<
 *                 ctx.literal('OR %s ' % self._on_conflict)
 * 
 */
          }

          /* "sweepea.pyx":2673
 * 
 *             (ctx
 *              .sql(self.table)             # <<<<<<<<<<<<<<
 *              .literal(' SET ')
 *              .sql(CommaList([
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2673, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_3, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2673, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "sweepea.pyx":2674
 *             (ctx
 *              .sql(self.table)
 *              .literal(' SET ')             # <<<<<<<<<<<<<<
 *              .sql(CommaList([
 *                  List((key, SQL('='), value))
 */
          __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_2)->__pyx_vtab)->literal(((struct __pyx_obj_7sweepea_Context *)__pyx_t_2), __pyx_kp_s_SET, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2674, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

          /* "sweepea.pyx":2675
 *              .sql(self.table)
 *              .literal(' SET ')
 *              .sql(CommaList([             # <<<<<<<<<<<<<<
 *                  List((key, SQL('='), value))
 *                  for key, value in self.data.items()])))
 */
          __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_CommaList); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2675, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2675, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_5);

          /* "sweepea.pyx":2677
 *              .sql(CommaList([
 *                  List((key, SQL('='), value))
 *                  for key, value in self.data.items()])))             # <<<<<<<<<<<<<<
 * 
 *             if self._where is not None:
 */
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2677, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_items); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2677, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_11)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
            }
          }
          if (__pyx_t_11) {
            __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2677, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          } else {
            __pyx_t_10 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2677, __pyx_L7_error)
          }
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
            __pyx_t_12 = __pyx_t_10; __Pyx_INCREF(__pyx_t_12); __pyx_t_13 = 0;
            __pyx_t_14 = NULL;
          } else {
            __pyx_t_13 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2677, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_12);
            __pyx_t_14 = Py_TYPE(__pyx_t_12)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 2677, __pyx_L7_error)
          }
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          for (;;) {
            if (likely(!__pyx_t_14)) {
              if (likely(PyList_CheckExact(__pyx_t_12))) {
                if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_12)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_10 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_13); __Pyx_INCREF(__pyx_t_10); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 2677, __pyx_L7_error)
                #else
                __pyx_t_10 = PySequence_ITEM(__pyx_t_12, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2677, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_10);
                #endif
              } else {
                if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
                #if CYTHON_COMPILING_IN_CPYTHON
                __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_13); __Pyx_INCREF(__pyx_t_10); __pyx_t_13++; if (unlikely(0 < 0)) __PYX_ERR(0, 2677, __pyx_L7_error)
                #else
                __pyx_t_10 = PySequence_ITEM(__pyx_t_12, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2677, __pyx_L7_error)
                __Pyx_GOTREF(__pyx_t_10);
                #endif
              }
            } else {
              __pyx_t_10 = __pyx_t_14(__pyx_t_12);
              if (unlikely(!__pyx_t_10)) {
                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, 2677, __pyx_L7_error)
                }
                break;
              }
              __Pyx_GOTREF(__pyx_t_10);
            }
            if ((likely(PyTuple_CheckExact(__pyx_t_10))) || (PyList_CheckExact(__pyx_t_10))) {
              PyObject* sequence = __pyx_t_10;
              #if CYTHON_COMPILING_IN_CPYTHON
              Py_ssize_t size = Py_SIZE(sequence);
              #else
              Py_ssize_t size = PySequence_Size(sequence);
              #endif
              if (unlikely(size != 2)) {
                if (size > 2) __Pyx_RaiseTooManyValuesError(2);
                else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
                __PYX_ERR(0, 2677, __pyx_L7_error)
              }
              #if CYTHON_COMPILING_IN_CPYTHON
              if (likely(PyTuple_CheckExact(sequence))) {
                __pyx_t_11 = PyTuple_GET_ITEM(sequence, 0); 
                __pyx_t_15 = PyTuple_GET_ITEM(sequence, 1); 
              } else {
                __pyx_t_11 = PyList_GET_ITEM(sequence, 0); 
                __pyx_t_15 = PyList_GET_ITEM(sequence, 1); 
              }
              __Pyx_INCREF(__pyx_t_11);
              __Pyx_INCREF(__pyx_t_15);
              #else
              __pyx_t_11 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2677, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_11);
              __pyx_t_15 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2677, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_15);
              #endif
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            } else {
              Py_ssize_t index = -1;
              __pyx_t_16 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2677, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_16);
              __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
              __pyx_t_17 = Py_TYPE(__pyx_t_16)->tp_iternext;
              index = 0; __pyx_t_11 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_11)) goto __pyx_L18_unpacking_failed;
              __Pyx_GOTREF(__pyx_t_11);
              index = 1; __pyx_t_15 = __pyx_t_17(__pyx_t_16); if (unlikely(!__pyx_t_15)) goto __pyx_L18_unpacking_failed;
              __Pyx_GOTREF(__pyx_t_15);
              if (__Pyx_IternextUnpackEndCheck(__pyx_t_17(__pyx_t_16), 2) < 0) __PYX_ERR(0, 2677, __pyx_L7_error)
              __pyx_t_17 = NULL;
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
              goto __pyx_L19_unpacking_done;
              __pyx_L18_unpacking_failed:;
              __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
              __pyx_t_17 = NULL;
              if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
              __PYX_ERR(0, 2677, __pyx_L7_error)
              __pyx_L19_unpacking_done:;
            }
            __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_11);
            __pyx_t_11 = 0;
            __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_15);
            __pyx_t_15 = 0;

            /* "sweepea.pyx":2676
 *              .literal(' SET ')
 *              .sql(CommaList([
 *                  List((key, SQL('='), value))             # <<<<<<<<<<<<<<
 *                  for key, value in self.data.items()])))
 * 
 */
            __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_List); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2676, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_15);
            __pyx_t_11 = __Pyx_GetModuleGlobalName(__pyx_n_s_SQL); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2676, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_16 = __Pyx_PyObject_Call(__pyx_t_11, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2676, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_16);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyTuple_New(3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2676, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_INCREF(__pyx_v_key);
            __Pyx_GIVEREF(__pyx_v_key);
            PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_v_key);
            __Pyx_GIVEREF(__pyx_t_16);
            PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_16);
            __Pyx_INCREF(__pyx_v_value);
            __Pyx_GIVEREF(__pyx_v_value);
            PyTuple_SET_ITEM(__pyx_t_11, 2, __pyx_v_value);
            __pyx_t_16 = 0;
            __pyx_t_16 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
              __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15);
              if (likely(__pyx_t_16)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_15);
                __Pyx_INCREF(__pyx_t_16);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_15, function);
              }
            }
            if (!__pyx_t_16) {
              __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_15, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2676, __pyx_L7_error)
              __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_GOTREF(__pyx_t_10);
            } else {
              __pyx_t_18 = PyTuple_New(1+1); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 2676, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_18);
              __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_16); __pyx_t_16 = NULL;
              __Pyx_GIVEREF(__pyx_t_11);
              PyTuple_SET_ITEM(__pyx_t_18, 0+1, __pyx_t_11);
              __pyx_t_11 = 0;
              __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_18, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2676, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_10);
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            }
            __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
            if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 2675, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

            /* "sweepea.pyx":2677
 *              .sql(CommaList([
 *                  List((key, SQL('='), value))
 *                  for key, value in self.data.items()])))             # <<<<<<<<<<<<<<
 * 
 *             if self._where is not None:
 */
          }
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && 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_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2675, __pyx_L7_error)
            __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_GOTREF(__pyx_t_2);
          } else {
            __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2675, __pyx_L7_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_GIVEREF(__pyx_t_5);
            PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_t_5);
            __pyx_t_5 = 0;
            __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2675, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "sweepea.pyx":2675
 *              .sql(self.table)
 *              .literal(' SET ')
 *              .sql(CommaList([             # <<<<<<<<<<<<<<
 *                  List((key, SQL('='), value))
 *                  for key, value in self.data.items()])))
 */
          __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_3)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_3), __pyx_t_2, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2675, __pyx_L7_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;

          /* "sweepea.pyx":2679
 *                  for key, value in self.data.items()])))
 * 
 *             if self._where is not None:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' WHERE ').sql(self._where)
 * 
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2679, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_9 = (__pyx_t_1 != Py_None);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_19 = (__pyx_t_9 != 0);
          if (__pyx_t_19) {

            /* "sweepea.pyx":2680
 * 
 *             if self._where is not None:
 *                 ctx.literal(' WHERE ').sql(self._where)             # <<<<<<<<<<<<<<
 * 
 *             return self.apply_ordering(ctx)
 */
            __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_WHERE, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2680, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2680, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_1)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_1), __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2680, __pyx_L7_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;

            /* "sweepea.pyx":2679
 *                  for key, value in self.data.items()])))
 * 
 *             if self._where is not None:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' WHERE ').sql(self._where)
 * 
 */
          }

          /* "sweepea.pyx":2682
 *                 ctx.literal(' WHERE ').sql(self._where)
 * 
 *             return self.apply_ordering(ctx)             # <<<<<<<<<<<<<<
 * 
 *     def execute(self, Database database):
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_apply_ordering); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2682, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_2, function);
            }
          }
          if (!__pyx_t_1) {
            __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_ctx)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2682, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
          } else {
            __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2682, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_10);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
            PyTuple_SET_ITEM(__pyx_t_10, 0+1, ((PyObject *)__pyx_v_ctx));
            __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2682, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          }
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __pyx_r = __pyx_t_3;
          __pyx_t_3 = 0;
          goto __pyx_L11_try_return;

          /* "sweepea.pyx":2667
 * 
 *     def __sql__(self, Context ctx):
 *         with ctx.scope_values(subquery=True):             # <<<<<<<<<<<<<<
 *             ctx.literal('UPDATE ')
 *             if self._on_conflict:
 */
        }
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
        __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("sweepea.Update.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_10) < 0) __PYX_ERR(0, 2667, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_1 = PyTuple_Pack(3, __pyx_t_3, __pyx_t_2, __pyx_t_10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2667, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_1, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 2667, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_20);
          __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_20);
          __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
          if (__pyx_t_19 < 0) __PYX_ERR(0, 2667, __pyx_L9_except_error)
          __pyx_t_9 = ((!(__pyx_t_19 != 0)) != 0);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_GIVEREF(__pyx_t_2);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_2, __pyx_t_10);
            __pyx_t_3 = 0; __pyx_t_2 = 0; __pyx_t_10 = 0; 
            __PYX_ERR(0, 2667, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L11_try_return:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L4_return;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_4) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__82, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2667, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L4_return: {
        __pyx_t_8 = __pyx_r;
        __pyx_r = 0;
        if (__pyx_t_4) {
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__83, NULL);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2667, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }
      __pyx_L6:;
    }
    goto __pyx_L24;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L1_error;
    __pyx_L24:;
  }

  /* "sweepea.pyx":2666
 *         self._on_conflict = on_conflict
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         with ctx.scope_values(subquery=True):
 *             ctx.literal('UPDATE ')
 */

  /* 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_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_AddTraceback("sweepea.Update.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2684
 *             return self.apply_ordering(ctx)
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         database.execute(self)
 *         return database.changes()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Update_9execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Update_9execute = {"execute", (PyCFunction)__pyx_pw_7sweepea_6Update_9execute, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Update_9execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Database *__pyx_v_database = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_database,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_database)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, 1); __PYX_ERR(0, 2684, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute") < 0)) __PYX_ERR(0, 2684, __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_database = ((struct __pyx_obj_7sweepea_Database *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2684, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Update.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_database), __pyx_ptype_7sweepea_Database, 1, "database", 0))) __PYX_ERR(0, 2684, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Update_8execute(__pyx_self, __pyx_v_self, __pyx_v_database);

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

static PyObject *__pyx_pf_7sweepea_6Update_8execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_database) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("execute", 0);

  /* "sweepea.pyx":2685
 * 
 *     def execute(self, Database database):
 *         database.execute(self)             # <<<<<<<<<<<<<<
 *         return database.changes()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_database->__pyx_vtab)->execute(__pyx_v_database, __pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2686
 *     def execute(self, Database database):
 *         database.execute(self)
 *         return database.changes()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_database->__pyx_vtab)->changes(__pyx_v_database); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2684
 *             return self.apply_ordering(ctx)
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         database.execute(self)
 *         return database.changes()
 */

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

/* "sweepea.pyx":2690
 * 
 * class Insert(WriteQuery):
 *     def __init__(self, table, data=None, columns=None, on_conflict=None):             # <<<<<<<<<<<<<<
 *         super(Insert, self).__init__(table)
 *         self.data = data
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Insert_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Insert_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_6Insert_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Insert_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_table = 0;
  PyObject *__pyx_v_data = 0;
  PyObject *__pyx_v_columns = 0;
  PyObject *__pyx_v_on_conflict = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_table,&__pyx_n_s_data,&__pyx_n_s_columns,&__pyx_n_s_on_conflict,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[2] = ((PyObject *)((PyObject *)Py_None));
    values[3] = ((PyObject *)((PyObject *)Py_None));
    values[4] = ((PyObject *)((PyObject *)Py_None));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        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_table)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); __PYX_ERR(0, 2690, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_data);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_columns);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_on_conflict);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2690, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        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_table = values[1];
    __pyx_v_data = values[2];
    __pyx_v_columns = values[3];
    __pyx_v_on_conflict = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2690, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Insert.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Insert___init__(__pyx_self, __pyx_v_self, __pyx_v_table, __pyx_v_data, __pyx_v_columns, __pyx_v_on_conflict);

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

static PyObject *__pyx_pf_7sweepea_6Insert___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_table, PyObject *__pyx_v_data, PyObject *__pyx_v_columns, PyObject *__pyx_v_on_conflict) {
  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("__init__", 0);

  /* "sweepea.pyx":2691
 * class Insert(WriteQuery):
 *     def __init__(self, table, data=None, columns=None, on_conflict=None):
 *         super(Insert, self).__init__(table)             # <<<<<<<<<<<<<<
 *         self.data = data
 *         self._columns = columns
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Insert); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2691, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_table); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(__pyx_v_table);
    __Pyx_GIVEREF(__pyx_v_table);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_table);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2691, __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;

  /* "sweepea.pyx":2692
 *     def __init__(self, table, data=None, columns=None, on_conflict=None):
 *         super(Insert, self).__init__(table)
 *         self.data = data             # <<<<<<<<<<<<<<
 *         self._columns = columns
 *         self._on_conflict = on_conflict
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_data, __pyx_v_data) < 0) __PYX_ERR(0, 2692, __pyx_L1_error)

  /* "sweepea.pyx":2693
 *         super(Insert, self).__init__(table)
 *         self.data = data
 *         self._columns = columns             # <<<<<<<<<<<<<<
 *         self._on_conflict = on_conflict
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_columns_2, __pyx_v_columns) < 0) __PYX_ERR(0, 2693, __pyx_L1_error)

  /* "sweepea.pyx":2694
 *         self.data = data
 *         self._columns = columns
 *         self._on_conflict = on_conflict             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_on_conflict_2, __pyx_v_on_conflict) < 0) __PYX_ERR(0, 2694, __pyx_L1_error)

  /* "sweepea.pyx":2690
 * 
 * class Insert(WriteQuery):
 *     def __init__(self, table, data=None, columns=None, on_conflict=None):             # <<<<<<<<<<<<<<
 *         super(Insert, self).__init__(table)
 *         self.data = data
 */

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

/* "sweepea.pyx":2697
 * 
 *     @Node.copy
 *     def on_conflict(self, on_conflict):             # <<<<<<<<<<<<<<
 *         self._on_conflict = on_conflict
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Insert_3on_conflict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Insert_3on_conflict = {"on_conflict", (PyCFunction)__pyx_pw_7sweepea_6Insert_3on_conflict, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Insert_3on_conflict(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_on_conflict = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_conflict (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_on_conflict,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_on_conflict)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("on_conflict", 1, 2, 2, 1); __PYX_ERR(0, 2697, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "on_conflict") < 0)) __PYX_ERR(0, 2697, __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_on_conflict = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("on_conflict", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2697, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Insert.on_conflict", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Insert_2on_conflict(__pyx_self, __pyx_v_self, __pyx_v_on_conflict);

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

static PyObject *__pyx_pf_7sweepea_6Insert_2on_conflict(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_on_conflict) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_conflict", 0);

  /* "sweepea.pyx":2698
 *     @Node.copy
 *     def on_conflict(self, on_conflict):
 *         self._on_conflict = on_conflict             # <<<<<<<<<<<<<<
 * 
 *     def _simple_insert(self, Context ctx):
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_on_conflict_2, __pyx_v_on_conflict) < 0) __PYX_ERR(0, 2698, __pyx_L1_error)

  /* "sweepea.pyx":2697
 * 
 *     @Node.copy
 *     def on_conflict(self, on_conflict):             # <<<<<<<<<<<<<<
 *         self._on_conflict = on_conflict
 * 
 */

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

/* "sweepea.pyx":2700
 *         self._on_conflict = on_conflict
 * 
 *     def _simple_insert(self, Context ctx):             # <<<<<<<<<<<<<<
 *         columns, values = [], []
 *         for key, value in self.data.items():
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Insert_5_simple_insert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Insert_5_simple_insert = {"_simple_insert", (PyCFunction)__pyx_pw_7sweepea_6Insert_5_simple_insert, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Insert_5_simple_insert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_simple_insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_simple_insert", 1, 2, 2, 1); __PYX_ERR(0, 2700, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_simple_insert") < 0)) __PYX_ERR(0, 2700, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_simple_insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2700, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Insert._simple_insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2700, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Insert_4_simple_insert(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_6Insert_4_simple_insert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_v_columns = NULL;
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("_simple_insert", 0);

  /* "sweepea.pyx":2701
 * 
 *     def _simple_insert(self, Context ctx):
 *         columns, values = [], []             # <<<<<<<<<<<<<<
 *         for key, value in self.data.items():
 *             columns.append(key)
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_columns = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_values = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "sweepea.pyx":2702
 *     def _simple_insert(self, Context ctx):
 *         columns, values = [], []
 *         for key, value in self.data.items():             # <<<<<<<<<<<<<<
 *             columns.append(key)
 *             if not isinstance(value, Node):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_items); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2702, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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, 2702, __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, 2702, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2702, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2702, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2702, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 2702, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2702, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 2702, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 2702, __pyx_L1_error)
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 2702, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 2702, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "sweepea.pyx":2703
 *         columns, values = [], []
 *         for key, value in self.data.items():
 *             columns.append(key)             # <<<<<<<<<<<<<<
 *             if not isinstance(value, Node):
 *                 value = Value(value)
 */
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_columns, __pyx_v_key); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 2703, __pyx_L1_error)

    /* "sweepea.pyx":2704
 *         for key, value in self.data.items():
 *             columns.append(key)
 *             if not isinstance(value, Node):             # <<<<<<<<<<<<<<
 *                 value = Value(value)
 *             values.append(value)
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = PyObject_IsInstance(__pyx_v_value, __pyx_t_2); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2704, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_11 = ((!(__pyx_t_10 != 0)) != 0);
    if (__pyx_t_11) {

      /* "sweepea.pyx":2705
 *             columns.append(key)
 *             if not isinstance(value, Node):
 *                 value = Value(value)             # <<<<<<<<<<<<<<
 *             values.append(value)
 *         return (ctx
 */
      __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_Value); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 2705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_1 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2705, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2705, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_1); __pyx_t_1 = NULL;
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_value);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2705, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "sweepea.pyx":2704
 *         for key, value in self.data.items():
 *             columns.append(key)
 *             if not isinstance(value, Node):             # <<<<<<<<<<<<<<
 *                 value = Value(value)
 *             values.append(value)
 */
    }

    /* "sweepea.pyx":2706
 *             if not isinstance(value, Node):
 *                 value = Value(value)
 *             values.append(value)             # <<<<<<<<<<<<<<
 *         return (ctx
 *                 .sql(EnclosedList(columns))
 */
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_values, __pyx_v_value); if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(0, 2706, __pyx_L1_error)

    /* "sweepea.pyx":2702
 *     def _simple_insert(self, Context ctx):
 *         columns, values = [], []
 *         for key, value in self.data.items():             # <<<<<<<<<<<<<<
 *             columns.append(key)
 *             if not isinstance(value, Node):
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "sweepea.pyx":2707
 *                 value = Value(value)
 *             values.append(value)
 *         return (ctx             # <<<<<<<<<<<<<<
 *                 .sql(EnclosedList(columns))
 *                 .literal(' VALUES ')
 */
  __Pyx_XDECREF(__pyx_r);

  /* "sweepea.pyx":2708
 *             values.append(value)
 *         return (ctx
 *                 .sql(EnclosedList(columns))             # <<<<<<<<<<<<<<
 *                 .literal(' VALUES ')
 *                 .sql(EnclosedList(values)))
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EnclosedList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_columns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_v_columns);
    __Pyx_GIVEREF(__pyx_v_columns);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_columns);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_3, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "sweepea.pyx":2709
 *         return (ctx
 *                 .sql(EnclosedList(columns))
 *                 .literal(' VALUES ')             # <<<<<<<<<<<<<<
 *                 .sql(EnclosedList(values)))
 * 
 */
  __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_2)->__pyx_vtab)->literal(((struct __pyx_obj_7sweepea_Context *)__pyx_t_2), __pyx_kp_s_VALUES, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2710
 *                 .sql(EnclosedList(columns))
 *                 .literal(' VALUES ')
 *                 .sql(EnclosedList(values)))             # <<<<<<<<<<<<<<
 * 
 *     def _multi_insert(self, Context ctx):
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_EnclosedList); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6); __pyx_t_6 = NULL;
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_values);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_3)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_3), __pyx_t_2, 0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2700
 *         self._on_conflict = on_conflict
 * 
 *     def _simple_insert(self, Context ctx):             # <<<<<<<<<<<<<<
 *         columns, values = [], []
 *         for key, value in self.data.items():
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("sweepea.Insert._simple_insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_columns);
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2712
 *                 .sql(EnclosedList(values)))
 * 
 *     def _multi_insert(self, Context ctx):             # <<<<<<<<<<<<<<
 *         rows_iter = iter(self.data)
 *         columns = self._columns
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Insert_7_multi_insert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Insert_7_multi_insert = {"_multi_insert", (PyCFunction)__pyx_pw_7sweepea_6Insert_7_multi_insert, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Insert_7_multi_insert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_multi_insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_multi_insert", 1, 2, 2, 1); __PYX_ERR(0, 2712, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_multi_insert") < 0)) __PYX_ERR(0, 2712, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_multi_insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2712, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Insert._multi_insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2712, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Insert_6_multi_insert(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_6Insert_6_multi_insert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_v_rows_iter = NULL;
  PyObject *__pyx_v_columns = NULL;
  PyObject *__pyx_v_row = NULL;
  PyObject *__pyx_v_all_values = NULL;
  PyObject *__pyx_v_values = NULL;
  PyObject *__pyx_v_column = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  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 *);
  Py_ssize_t __pyx_t_14;
  PyObject *(*__pyx_t_15)(PyObject *);
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  __Pyx_RefNannySetupContext("_multi_insert", 0);

  /* "sweepea.pyx":2713
 * 
 *     def _multi_insert(self, Context ctx):
 *         rows_iter = iter(self.data)             # <<<<<<<<<<<<<<
 *         columns = self._columns
 *         if not columns:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2713, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_rows_iter = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "sweepea.pyx":2714
 *     def _multi_insert(self, Context ctx):
 *         rows_iter = iter(self.data)
 *         columns = self._columns             # <<<<<<<<<<<<<<
 *         if not columns:
 *             try:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_columns_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_columns = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "sweepea.pyx":2715
 *         rows_iter = iter(self.data)
 *         columns = self._columns
 *         if not columns:             # <<<<<<<<<<<<<<
 *             try:
 *                 row = next(rows_iter)
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_columns); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 2715, __pyx_L1_error)
  __pyx_t_4 = ((!__pyx_t_3) != 0);
  if (__pyx_t_4) {

    /* "sweepea.pyx":2716
 *         columns = self._columns
 *         if not columns:
 *             try:             # <<<<<<<<<<<<<<
 *                 row = next(rows_iter)
 *             except StopIteration:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "sweepea.pyx":2717
 *         if not columns:
 *             try:
 *                 row = next(rows_iter)             # <<<<<<<<<<<<<<
 *             except StopIteration:
 *                 return ctx.sql('DEFAULT VALUES')
 */
        __pyx_t_2 = __Pyx_PyIter_Next(__pyx_v_rows_iter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2717, __pyx_L4_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_v_row = __pyx_t_2;
        __pyx_t_2 = 0;

        /* "sweepea.pyx":2716
 *         columns = self._columns
 *         if not columns:
 *             try:             # <<<<<<<<<<<<<<
 *                 row = next(rows_iter)
 *             except StopIteration:
 */
      }
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L11_try_end;
      __pyx_L4_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "sweepea.pyx":2718
 *             try:
 *                 row = next(rows_iter)
 *             except StopIteration:             # <<<<<<<<<<<<<<
 *                 return ctx.sql('DEFAULT VALUES')
 *             columns = row.keys()
 */
      __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_StopIteration);
      if (__pyx_t_8) {
        __Pyx_AddTraceback("sweepea.Insert._multi_insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_9) < 0) __PYX_ERR(0, 2718, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_9);

        /* "sweepea.pyx":2719
 *                 row = next(rows_iter)
 *             except StopIteration:
 *                 return ctx.sql('DEFAULT VALUES')             # <<<<<<<<<<<<<<
 *             columns = row.keys()
 *             rows_iter = itertools.chain(iter((row,)), rows_iter)
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_10 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_kp_s_DEFAULT_VALUES, 0)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2719, __pyx_L6_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_r = __pyx_t_10;
        __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L7_except_return;
      }
      goto __pyx_L6_except_error;
      __pyx_L6_except_error:;

      /* "sweepea.pyx":2716
 *         columns = self._columns
 *         if not columns:
 *             try:             # <<<<<<<<<<<<<<
 *                 row = next(rows_iter)
 *             except StopIteration:
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L7_except_return:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
      __pyx_L11_try_end:;
    }

    /* "sweepea.pyx":2720
 *             except StopIteration:
 *                 return ctx.sql('DEFAULT VALUES')
 *             columns = row.keys()             # <<<<<<<<<<<<<<
 *             rows_iter = itertools.chain(iter((row,)), rows_iter)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_row, __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2720, __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, 2720, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_columns, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "sweepea.pyx":2721
 *                 return ctx.sql('DEFAULT VALUES')
 *             columns = row.keys()
 *             rows_iter = itertools.chain(iter((row,)), rows_iter)             # <<<<<<<<<<<<<<
 * 
 *         ctx.sql(EnclosedList(columns)).literal(' VALUES ')
 */
    __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_itertools); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_chain); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_row);
    __Pyx_GIVEREF(__pyx_v_row);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_row);
    __pyx_t_10 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    __pyx_t_11 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_11 = 1;
      }
    }
    __pyx_t_12 = PyTuple_New(2+__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_10);
    __Pyx_INCREF(__pyx_v_rows_iter);
    __Pyx_GIVEREF(__pyx_v_rows_iter);
    PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_v_rows_iter);
    __pyx_t_10 = 0;
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_rows_iter, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "sweepea.pyx":2715
 *         rows_iter = iter(self.data)
 *         columns = self._columns
 *         if not columns:             # <<<<<<<<<<<<<<
 *             try:
 *                 row = next(rows_iter)
 */
  }

  /* "sweepea.pyx":2723
 *             rows_iter = itertools.chain(iter((row,)), rows_iter)
 * 
 *         ctx.sql(EnclosedList(columns)).literal(' VALUES ')             # <<<<<<<<<<<<<<
 *         all_values = []
 *         for row in rows_iter:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EnclosedList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_12 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_12)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_12);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_12) {
    __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_columns); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
  } else {
    __pyx_t_10 = PyTuple_New(1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2723, __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_columns);
    __Pyx_GIVEREF(__pyx_v_columns);
    PyTuple_SET_ITEM(__pyx_t_10, 0+1, __pyx_v_columns);
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_9, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_2)->__pyx_vtab)->literal(((struct __pyx_obj_7sweepea_Context *)__pyx_t_2), __pyx_kp_s_VALUES, 0)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "sweepea.pyx":2724
 * 
 *         ctx.sql(EnclosedList(columns)).literal(' VALUES ')
 *         all_values = []             # <<<<<<<<<<<<<<
 *         for row in rows_iter:
 *             values = []
 */
  __pyx_t_9 = PyList_New(0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_v_all_values = ((PyObject*)__pyx_t_9);
  __pyx_t_9 = 0;

  /* "sweepea.pyx":2725
 *         ctx.sql(EnclosedList(columns)).literal(' VALUES ')
 *         all_values = []
 *         for row in rows_iter:             # <<<<<<<<<<<<<<
 *             values = []
 *             for column in columns:
 */
  if (likely(PyList_CheckExact(__pyx_v_rows_iter)) || PyTuple_CheckExact(__pyx_v_rows_iter)) {
    __pyx_t_9 = __pyx_v_rows_iter; __Pyx_INCREF(__pyx_t_9); __pyx_t_11 = 0;
    __pyx_t_13 = NULL;
  } else {
    __pyx_t_11 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_rows_iter); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_13 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 2725, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_13)) {
      if (likely(PyList_CheckExact(__pyx_t_9))) {
        if (__pyx_t_11 >= PyList_GET_SIZE(__pyx_t_9)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 2725, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_11 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_11); __Pyx_INCREF(__pyx_t_2); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 2725, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_9, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2725, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_13(__pyx_t_9);
      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, 2725, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_row, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "sweepea.pyx":2726
 *         all_values = []
 *         for row in rows_iter:
 *             values = []             # <<<<<<<<<<<<<<
 *             for column in columns:
 *                 value = row[column]
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_values, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "sweepea.pyx":2727
 *         for row in rows_iter:
 *             values = []
 *             for column in columns:             # <<<<<<<<<<<<<<
 *                 value = row[column]
 *                 if not isinstance(value, Node):
 */
    if (likely(PyList_CheckExact(__pyx_v_columns)) || PyTuple_CheckExact(__pyx_v_columns)) {
      __pyx_t_2 = __pyx_v_columns; __Pyx_INCREF(__pyx_t_2); __pyx_t_14 = 0;
      __pyx_t_15 = NULL;
    } else {
      __pyx_t_14 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_columns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2727, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_15 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 2727, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_15)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_14 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 2727, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_2, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2727, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          if (__pyx_t_14 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_14); __Pyx_INCREF(__pyx_t_10); __pyx_t_14++; if (unlikely(0 < 0)) __PYX_ERR(0, 2727, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_2, __pyx_t_14); __pyx_t_14++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2727, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_15(__pyx_t_2);
        if (unlikely(!__pyx_t_10)) {
          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, 2727, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_column, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "sweepea.pyx":2728
 *             values = []
 *             for column in columns:
 *                 value = row[column]             # <<<<<<<<<<<<<<
 *                 if not isinstance(value, Node):
 *                     value = Value(value)
 */
      __pyx_t_10 = PyObject_GetItem(__pyx_v_row, __pyx_v_column); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2728, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_10);
      __pyx_t_10 = 0;

      /* "sweepea.pyx":2729
 *             for column in columns:
 *                 value = row[column]
 *                 if not isinstance(value, Node):             # <<<<<<<<<<<<<<
 *                     value = Value(value)
 *                 values.append(value)
 */
      __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2729, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_4 = PyObject_IsInstance(__pyx_v_value, __pyx_t_10); if (unlikely(__pyx_t_4 == -1)) __PYX_ERR(0, 2729, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_3 = ((!(__pyx_t_4 != 0)) != 0);
      if (__pyx_t_3) {

        /* "sweepea.pyx":2730
 *                 value = row[column]
 *                 if not isinstance(value, Node):
 *                     value = Value(value)             # <<<<<<<<<<<<<<
 *                 values.append(value)
 * 
 */
        __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_Value); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 2730, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_1 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_1)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        if (!__pyx_t_1) {
          __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_v_value); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
        } else {
          __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_16);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_INCREF(__pyx_v_value);
          __Pyx_GIVEREF(__pyx_v_value);
          PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_v_value);
          __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2730, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        }
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_10);
        __pyx_t_10 = 0;

        /* "sweepea.pyx":2729
 *             for column in columns:
 *                 value = row[column]
 *                 if not isinstance(value, Node):             # <<<<<<<<<<<<<<
 *                     value = Value(value)
 *                 values.append(value)
 */
      }

      /* "sweepea.pyx":2731
 *                 if not isinstance(value, Node):
 *                     value = Value(value)
 *                 values.append(value)             # <<<<<<<<<<<<<<
 * 
 *             all_values.append(EnclosedList(values))
 */
      __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_values, __pyx_v_value); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 2731, __pyx_L1_error)

      /* "sweepea.pyx":2727
 *         for row in rows_iter:
 *             values = []
 *             for column in columns:             # <<<<<<<<<<<<<<
 *                 value = row[column]
 *                 if not isinstance(value, Node):
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":2733
 *                 values.append(value)
 * 
 *             all_values.append(EnclosedList(values))             # <<<<<<<<<<<<<<
 * 
 *         return ctx.sql(CommaList(all_values))
 */
    __pyx_t_10 = __Pyx_GetModuleGlobalName(__pyx_n_s_EnclosedList); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 2733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    if (!__pyx_t_12) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_v_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2733, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2733, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_12); __pyx_t_12 = NULL;
      __Pyx_INCREF(__pyx_v_values);
      __Pyx_GIVEREF(__pyx_v_values);
      PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_v_values);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_16, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2733, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __pyx_t_17 = __Pyx_PyList_Append(__pyx_v_all_values, __pyx_t_2); if (unlikely(__pyx_t_17 == -1)) __PYX_ERR(0, 2733, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "sweepea.pyx":2725
 *         ctx.sql(EnclosedList(columns)).literal(' VALUES ')
 *         all_values = []
 *         for row in rows_iter:             # <<<<<<<<<<<<<<
 *             values = []
 *             for column in columns:
 */
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "sweepea.pyx":2735
 *             all_values.append(EnclosedList(values))
 * 
 *         return ctx.sql(CommaList(all_values))             # <<<<<<<<<<<<<<
 * 
 *     def _query_insert(self, Context ctx):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_CommaList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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);
    }
  }
  if (!__pyx_t_10) {
    __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_all_values); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
  } else {
    __pyx_t_16 = PyTuple_New(1+1); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 2735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_16);
    __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_10); __pyx_t_10 = NULL;
    __Pyx_INCREF(__pyx_v_all_values);
    __Pyx_GIVEREF(__pyx_v_all_values);
    PyTuple_SET_ITEM(__pyx_t_16, 0+1, __pyx_v_all_values);
    __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_16, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_9, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2712
 *                 .sql(EnclosedList(values)))
 * 
 *     def _multi_insert(self, Context ctx):             # <<<<<<<<<<<<<<
 *         rows_iter = iter(self.data)
 *         columns = self._columns
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("sweepea.Insert._multi_insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_rows_iter);
  __Pyx_XDECREF(__pyx_v_columns);
  __Pyx_XDECREF(__pyx_v_row);
  __Pyx_XDECREF(__pyx_v_all_values);
  __Pyx_XDECREF(__pyx_v_values);
  __Pyx_XDECREF(__pyx_v_column);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2737
 *         return ctx.sql(CommaList(all_values))
 * 
 *     def _query_insert(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return (ctx
 *                 .sql(EnclosedList(self._columns))
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Insert_9_query_insert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Insert_9_query_insert = {"_query_insert", (PyCFunction)__pyx_pw_7sweepea_6Insert_9_query_insert, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Insert_9_query_insert(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_query_insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_query_insert", 1, 2, 2, 1); __PYX_ERR(0, 2737, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_query_insert") < 0)) __PYX_ERR(0, 2737, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_query_insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2737, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Insert._query_insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2737, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Insert_8_query_insert(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_6Insert_8_query_insert(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  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;
  __Pyx_RefNannySetupContext("_query_insert", 0);

  /* "sweepea.pyx":2738
 * 
 *     def _query_insert(self, Context ctx):
 *         return (ctx             # <<<<<<<<<<<<<<
 *                 .sql(EnclosedList(self._columns))
 *                 .literal(' ')
 */
  __Pyx_XDECREF(__pyx_r);

  /* "sweepea.pyx":2739
 *     def _query_insert(self, Context ctx):
 *         return (ctx
 *                 .sql(EnclosedList(self._columns))             # <<<<<<<<<<<<<<
 *                 .literal(' ')
 *                 .sql(self.data))
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EnclosedList); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_columns_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2739, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2739, __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_3);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2739, __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_t_2 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->sql(__pyx_v_ctx, __pyx_t_1, 0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2740
 *         return (ctx
 *                 .sql(EnclosedList(self._columns))
 *                 .literal(' ')             # <<<<<<<<<<<<<<
 *                 .sql(self.data))
 * 
 */
  __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_2)->__pyx_vtab)->literal(((struct __pyx_obj_7sweepea_Context *)__pyx_t_2), __pyx_kp_s__57, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2741
 *                 .sql(EnclosedList(self._columns))
 *                 .literal(' ')
 *                 .sql(self.data))             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_1)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_1), __pyx_t_2, 0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2741, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2737
 *         return ctx.sql(CommaList(all_values))
 * 
 *     def _query_insert(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return (ctx
 *                 .sql(EnclosedList(self._columns))
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("sweepea.Insert._query_insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2743
 *                 .sql(self.data))
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         super(Insert, self).__sql__(ctx)
 *         with ctx.scope_values():
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Insert_11__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Insert_11__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_6Insert_11__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Insert_11__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2743, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2743, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2743, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Insert.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2743, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Insert_10__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_6Insert_10__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__sql__", 0);
  __Pyx_INCREF((PyObject *)__pyx_v_ctx);

  /* "sweepea.pyx":2744
 * 
 *     def __sql__(self, Context ctx):
 *         super(Insert, self).__sql__(ctx)             # <<<<<<<<<<<<<<
 *         with ctx.scope_values():
 *             ctx.literal('INSERT ')
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Insert); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sql_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_ctx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_ctx));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2744, __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;

  /* "sweepea.pyx":2745
 *     def __sql__(self, Context ctx):
 *         super(Insert, self).__sql__(ctx)
 *         with ctx.scope_values():             # <<<<<<<<<<<<<<
 *             ctx.literal('INSERT ')
 *             if self._on_conflict:
 */
  /*with:*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ctx), __pyx_n_s_scope_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2745, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2745, __pyx_L1_error)
    }
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2745, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2745, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2745, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_3);
    __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;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "sweepea.pyx":2746
 *         super(Insert, self).__sql__(ctx)
 *         with ctx.scope_values():
 *             ctx.literal('INSERT ')             # <<<<<<<<<<<<<<
 *             if self._on_conflict:
 *                 ctx.literal('OR %s ' % self._on_conflict)
 */
          __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_INSERT_2, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2746, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

          /* "sweepea.pyx":2747
 *         with ctx.scope_values():
 *             ctx.literal('INSERT ')
 *             if self._on_conflict:             # <<<<<<<<<<<<<<
 *                 ctx.literal('OR %s ' % self._on_conflict)
 *             ctx.literal('INTO ').sql(self.table).literal(' ')
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_conflict_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2747, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 2747, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (__pyx_t_9) {

            /* "sweepea.pyx":2748
 *             ctx.literal('INSERT ')
 *             if self._on_conflict:
 *                 ctx.literal('OR %s ' % self._on_conflict)             # <<<<<<<<<<<<<<
 *             ctx.literal('INTO ').sql(self.table).literal(' ')
 *             if isinstance(self.data, dict):
 */
            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_on_conflict_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2748, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_OR_s, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2748, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2748, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

            /* "sweepea.pyx":2747
 *         with ctx.scope_values():
 *             ctx.literal('INSERT ')
 *             if self._on_conflict:             # <<<<<<<<<<<<<<
 *                 ctx.literal('OR %s ' % self._on_conflict)
 *             ctx.literal('INTO ').sql(self.table).literal(' ')
 */
          }

          /* "sweepea.pyx":2749
 *             if self._on_conflict:
 *                 ctx.literal('OR %s ' % self._on_conflict)
 *             ctx.literal('INTO ').sql(self.table).literal(' ')             # <<<<<<<<<<<<<<
 *             if isinstance(self.data, dict):
 *                 ctx = self._simple_insert(ctx)
 */
          __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_INTO, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2749, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2749, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_1)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_1), __pyx_t_3, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2749, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_4)->__pyx_vtab)->literal(((struct __pyx_obj_7sweepea_Context *)__pyx_t_4), __pyx_kp_s__57, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2749, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

          /* "sweepea.pyx":2750
 *                 ctx.literal('OR %s ' % self._on_conflict)
 *             ctx.literal('INTO ').sql(self.table).literal(' ')
 *             if isinstance(self.data, dict):             # <<<<<<<<<<<<<<
 *                 ctx = self._simple_insert(ctx)
 *             elif isinstance(self.data, SelectBase):
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2750, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_9 = PyDict_Check(__pyx_t_3); 
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_10 = (__pyx_t_9 != 0);
          if (__pyx_t_10) {

            /* "sweepea.pyx":2751
 *             ctx.literal('INTO ').sql(self.table).literal(' ')
 *             if isinstance(self.data, dict):
 *                 ctx = self._simple_insert(ctx)             # <<<<<<<<<<<<<<
 *             elif isinstance(self.data, SelectBase):
 *                 ctx = self._query_insert(ctx)
 */
            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_simple_insert); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2751, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_1 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
              if (likely(__pyx_t_1)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_4, function);
              }
            }
            if (!__pyx_t_1) {
              __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, ((PyObject *)__pyx_v_ctx)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2751, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_3);
            } else {
              __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2751, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
              __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
              __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
              PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_ctx));
              __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2751, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_7sweepea_Context))))) __PYX_ERR(0, 2751, __pyx_L7_error)
            __Pyx_DECREF_SET(__pyx_v_ctx, ((struct __pyx_obj_7sweepea_Context *)__pyx_t_3));
            __pyx_t_3 = 0;

            /* "sweepea.pyx":2750
 *                 ctx.literal('OR %s ' % self._on_conflict)
 *             ctx.literal('INTO ').sql(self.table).literal(' ')
 *             if isinstance(self.data, dict):             # <<<<<<<<<<<<<<
 *                 ctx = self._simple_insert(ctx)
 *             elif isinstance(self.data, SelectBase):
 */
            goto __pyx_L16;
          }

          /* "sweepea.pyx":2752
 *             if isinstance(self.data, dict):
 *                 ctx = self._simple_insert(ctx)
 *             elif isinstance(self.data, SelectBase):             # <<<<<<<<<<<<<<
 *                 ctx = self._query_insert(ctx)
 *             else:
 */
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2752, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_SelectBase); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2752, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_10 = PyObject_IsInstance(__pyx_t_3, __pyx_t_4); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 2752, __pyx_L7_error)
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __pyx_t_9 = (__pyx_t_10 != 0);
          if (__pyx_t_9) {

            /* "sweepea.pyx":2753
 *                 ctx = self._simple_insert(ctx)
 *             elif isinstance(self.data, SelectBase):
 *                 ctx = self._query_insert(ctx)             # <<<<<<<<<<<<<<
 *             else:
 *                 ctx = self._multi_insert(ctx)
 */
            __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_query_insert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2753, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_2 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_2)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_2);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            if (!__pyx_t_2) {
              __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_ctx)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2753, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_4);
            } else {
              __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2753, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL;
              __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
              __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
              PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_ctx));
              __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2753, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            }
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7sweepea_Context))))) __PYX_ERR(0, 2753, __pyx_L7_error)
            __Pyx_DECREF_SET(__pyx_v_ctx, ((struct __pyx_obj_7sweepea_Context *)__pyx_t_4));
            __pyx_t_4 = 0;

            /* "sweepea.pyx":2752
 *             if isinstance(self.data, dict):
 *                 ctx = self._simple_insert(ctx)
 *             elif isinstance(self.data, SelectBase):             # <<<<<<<<<<<<<<
 *                 ctx = self._query_insert(ctx)
 *             else:
 */
            goto __pyx_L16;
          }

          /* "sweepea.pyx":2755
 *                 ctx = self._query_insert(ctx)
 *             else:
 *                 ctx = self._multi_insert(ctx)             # <<<<<<<<<<<<<<
 *         return ctx
 * 
 */
          /*else*/ {
            __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_multi_insert); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2755, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_1 = NULL;
            if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
              if (likely(__pyx_t_1)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
                __Pyx_INCREF(__pyx_t_1);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_3, function);
              }
            }
            if (!__pyx_t_1) {
              __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_ctx)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2755, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_4);
            } else {
              __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2755, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
              __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
              __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
              PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_ctx));
              __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2755, __pyx_L7_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(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_7sweepea_Context))))) __PYX_ERR(0, 2755, __pyx_L7_error)
            __Pyx_DECREF_SET(__pyx_v_ctx, ((struct __pyx_obj_7sweepea_Context *)__pyx_t_4));
            __pyx_t_4 = 0;
          }
          __pyx_L16:;

          /* "sweepea.pyx":2745
 *     def __sql__(self, Context ctx):
 *         super(Insert, self).__sql__(ctx)
 *         with ctx.scope_values():             # <<<<<<<<<<<<<<
 *             ctx.literal('INSERT ')
 *             if self._on_conflict:
 */
        }
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L14_try_end;
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("sweepea.Insert.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 2745, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2745, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2745, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_9 < 0) __PYX_ERR(0, 2745, __pyx_L9_except_error)
          __pyx_t_10 = ((!(__pyx_t_9 != 0)) != 0);
          if (__pyx_t_10) {
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_3, __pyx_t_2);
            __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
            __PYX_ERR(0, 2745, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        __pyx_L14_try_end:;
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_5) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__84, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2745, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L6:;
    }
    goto __pyx_L20;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L1_error;
    __pyx_L20:;
  }

  /* "sweepea.pyx":2756
 *             else:
 *                 ctx = self._multi_insert(ctx)
 *         return ctx             # <<<<<<<<<<<<<<
 * 
 *     def execute(self, Database database):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
  __pyx_r = ((PyObject *)__pyx_v_ctx);
  goto __pyx_L0;

  /* "sweepea.pyx":2743
 *                 .sql(self.data))
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         super(Insert, self).__sql__(ctx)
 *         with ctx.scope_values():
 */

  /* 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("sweepea.Insert.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_ctx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2758
 *         return ctx
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         database.execute(self)
 *         return database.last_insert_rowid()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Insert_13execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Insert_13execute = {"execute", (PyCFunction)__pyx_pw_7sweepea_6Insert_13execute, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Insert_13execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Database *__pyx_v_database = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_database,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_database)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, 1); __PYX_ERR(0, 2758, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute") < 0)) __PYX_ERR(0, 2758, __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_database = ((struct __pyx_obj_7sweepea_Database *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2758, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Insert.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_database), __pyx_ptype_7sweepea_Database, 1, "database", 0))) __PYX_ERR(0, 2758, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Insert_12execute(__pyx_self, __pyx_v_self, __pyx_v_database);

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

static PyObject *__pyx_pf_7sweepea_6Insert_12execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_database) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("execute", 0);

  /* "sweepea.pyx":2759
 * 
 *     def execute(self, Database database):
 *         database.execute(self)             # <<<<<<<<<<<<<<
 *         return database.last_insert_rowid()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_database->__pyx_vtab)->execute(__pyx_v_database, __pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2760
 *     def execute(self, Database database):
 *         database.execute(self)
 *         return database.last_insert_rowid()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_database->__pyx_vtab)->last_insert_rowid(__pyx_v_database); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2758
 *         return ctx
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         database.execute(self)
 *         return database.last_insert_rowid()
 */

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

/* "sweepea.pyx":2764
 * 
 * class Delete(WriteQuery):
 *     def __init__(self, table, where=None, **kwargs):             # <<<<<<<<<<<<<<
 *         super(Delete, self).__init__(table, **kwargs)
 *         self._where = where
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Delete_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Delete_1__init__ = {"__init__", (PyCFunction)__pyx_pw_7sweepea_6Delete_1__init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Delete_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_table = 0;
  PyObject *__pyx_v_where = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_table,&__pyx_n_s_where,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((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  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_table)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 2764, __pyx_L3_error)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_where);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 2764, __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_table = values[1];
    __pyx_v_where = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2764, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("sweepea.Delete.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Delete___init__(__pyx_self, __pyx_v_self, __pyx_v_table, __pyx_v_where, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_7sweepea_6Delete___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_table, PyObject *__pyx_v_where, PyObject *__pyx_v_kwargs) {
  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);

  /* "sweepea.pyx":2765
 * class Delete(WriteQuery):
 *     def __init__(self, table, where=None, **kwargs):
 *         super(Delete, self).__init__(table, **kwargs)             # <<<<<<<<<<<<<<
 *         self._where = where
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Delete); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_table);
  __Pyx_GIVEREF(__pyx_v_table);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_table);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2765, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "sweepea.pyx":2766
 *     def __init__(self, table, where=None, **kwargs):
 *         super(Delete, self).__init__(table, **kwargs)
 *         self._where = where             # <<<<<<<<<<<<<<
 * 
 *     @Node.copy
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_where_2, __pyx_v_where) < 0) __PYX_ERR(0, 2766, __pyx_L1_error)

  /* "sweepea.pyx":2764
 * 
 * class Delete(WriteQuery):
 *     def __init__(self, table, where=None, **kwargs):             # <<<<<<<<<<<<<<
 *         super(Delete, self).__init__(table, **kwargs)
 *         self._where = where
 */

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

/* "sweepea.pyx":2769
 * 
 *     @Node.copy
 *     def where(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Delete_3where(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Delete_3where = {"where", (PyCFunction)__pyx_pw_7sweepea_6Delete_3where, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Delete_3where(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_expressions = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("where (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_expressions = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_expressions)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_expressions);
  } else {
    __pyx_v_expressions = __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, "where") < 0)) __PYX_ERR(0, 2769, __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("where", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2769, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_expressions); __pyx_v_expressions = 0;
  __Pyx_AddTraceback("sweepea.Delete.where", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_7sweepea_6Delete_2where(__pyx_self, __pyx_v_self, __pyx_v_expressions);

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

static PyObject *__pyx_pf_7sweepea_6Delete_2where(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_expressions) {
  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("where", 0);
  __Pyx_INCREF(__pyx_v_expressions);

  /* "sweepea.pyx":2770
 *     @Node.copy
 *     def where(self, *expressions):
 *         if self._where is not None:             # <<<<<<<<<<<<<<
 *             expressions = (self._where,) + expressions
 *         self._where = reduce(operator.and_, expressions)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2770, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "sweepea.pyx":2771
 *     def where(self, *expressions):
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions             # <<<<<<<<<<<<<<
 *         self._where = reduce(operator.and_, expressions)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_v_expressions); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_expressions, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "sweepea.pyx":2770
 *     @Node.copy
 *     def where(self, *expressions):
 *         if self._where is not None:             # <<<<<<<<<<<<<<
 *             expressions = (self._where,) + expressions
 *         self._where = reduce(operator.and_, expressions)
 */
  }

  /* "sweepea.pyx":2772
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 *         self._where = reduce(operator.and_, expressions)             # <<<<<<<<<<<<<<
 * 
 *     def __sql__(self, Context ctx):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_operator); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_and); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_expressions);
  __Pyx_GIVEREF(__pyx_v_expressions);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_expressions);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_reduce, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_where_2, __pyx_t_4) < 0) __PYX_ERR(0, 2772, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2769
 * 
 *     @Node.copy
 *     def where(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 */

  /* 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_AddTraceback("sweepea.Delete.where", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_expressions);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2774
 *         self._where = reduce(operator.and_, expressions)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         super(Delete, self).__sql__(ctx)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Delete_5__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Delete_5__sql__ = {"__sql__", (PyCFunction)__pyx_pw_7sweepea_6Delete_5__sql__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Delete_5__sql__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Context *__pyx_v_ctx = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sql__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_ctx,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_ctx)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, 1); __PYX_ERR(0, 2774, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__sql__") < 0)) __PYX_ERR(0, 2774, __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_ctx = ((struct __pyx_obj_7sweepea_Context *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__sql__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2774, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Delete.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ctx), __pyx_ptype_7sweepea_Context, 1, "ctx", 0))) __PYX_ERR(0, 2774, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Delete_4__sql__(__pyx_self, __pyx_v_self, __pyx_v_ctx);

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

static PyObject *__pyx_pf_7sweepea_6Delete_4__sql__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Context *__pyx_v_ctx) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__sql__", 0);

  /* "sweepea.pyx":2775
 * 
 *     def __sql__(self, Context ctx):
 *         super(Delete, self).__sql__(ctx)             # <<<<<<<<<<<<<<
 * 
 *         with ctx.scope_values(subquery=True):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Delete); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_super, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sql_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_2) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_ctx)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
    __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_ctx));
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2775, __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;

  /* "sweepea.pyx":2777
 *         super(Delete, self).__sql__(ctx)
 * 
 *         with ctx.scope_values(subquery=True):             # <<<<<<<<<<<<<<
 *             ctx.literal('DELETE FROM ').sql(self.table)
 *             if self._where is not None:
 */
  /*with:*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_ctx), __pyx_n_s_scope_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_subquery, Py_True) < 0) __PYX_ERR(0, 2777, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2777, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_LookupSpecial(__pyx_t_4, __pyx_n_s_enter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2777, __pyx_L3_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_2) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2777, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2777, __pyx_L3_error)
    }
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /*try:*/ {
      {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
        __Pyx_XGOTREF(__pyx_t_6);
        __Pyx_XGOTREF(__pyx_t_7);
        __Pyx_XGOTREF(__pyx_t_8);
        /*try:*/ {

          /* "sweepea.pyx":2778
 * 
 *         with ctx.scope_values(subquery=True):
 *             ctx.literal('DELETE FROM ').sql(self.table)             # <<<<<<<<<<<<<<
 *             if self._where is not None:
 *                 ctx.literal(' WHERE ').sql(self._where)
 */
          __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_DELETE_FROM, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2778, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_table); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2778, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_4)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_4), __pyx_t_3, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2778, __pyx_L7_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;

          /* "sweepea.pyx":2779
 *         with ctx.scope_values(subquery=True):
 *             ctx.literal('DELETE FROM ').sql(self.table)
 *             if self._where is not None:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' WHERE ').sql(self._where)
 *             return self.apply_ordering(ctx)
 */
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2779, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_9 = (__pyx_t_1 != Py_None);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_10 = (__pyx_t_9 != 0);
          if (__pyx_t_10) {

            /* "sweepea.pyx":2780
 *             ctx.literal('DELETE FROM ').sql(self.table)
 *             if self._where is not None:
 *                 ctx.literal(' WHERE ').sql(self._where)             # <<<<<<<<<<<<<<
 *             return self.apply_ordering(ctx)
 * 
 */
            __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)__pyx_v_ctx->__pyx_vtab)->literal(__pyx_v_ctx, __pyx_kp_s_WHERE, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2780, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_where_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2780, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_3);
            __pyx_t_4 = ((PyObject *)((struct __pyx_vtabstruct_7sweepea_Context *)((struct __pyx_obj_7sweepea_Context *)__pyx_t_1)->__pyx_vtab)->sql(((struct __pyx_obj_7sweepea_Context *)__pyx_t_1), __pyx_t_3, 0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2780, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

            /* "sweepea.pyx":2779
 *         with ctx.scope_values(subquery=True):
 *             ctx.literal('DELETE FROM ').sql(self.table)
 *             if self._where is not None:             # <<<<<<<<<<<<<<
 *                 ctx.literal(' WHERE ').sql(self._where)
 *             return self.apply_ordering(ctx)
 */
          }

          /* "sweepea.pyx":2781
 *             if self._where is not None:
 *                 ctx.literal(' WHERE ').sql(self._where)
 *             return self.apply_ordering(ctx)             # <<<<<<<<<<<<<<
 * 
 *     def execute(self, Database database):
 */
          __Pyx_XDECREF(__pyx_r);
          __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_apply_ordering); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2781, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = NULL;
          if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
            if (likely(__pyx_t_1)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_1);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_3, function);
            }
          }
          if (!__pyx_t_1) {
            __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_ctx)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2781, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_4);
          } else {
            __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2781, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_2);
            __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
            __Pyx_INCREF(((PyObject *)__pyx_v_ctx));
            __Pyx_GIVEREF(((PyObject *)__pyx_v_ctx));
            PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_ctx));
            __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2781, __pyx_L7_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_r = __pyx_t_4;
          __pyx_t_4 = 0;
          goto __pyx_L11_try_return;

          /* "sweepea.pyx":2777
 *         super(Delete, self).__sql__(ctx)
 * 
 *         with ctx.scope_values(subquery=True):             # <<<<<<<<<<<<<<
 *             ctx.literal('DELETE FROM ').sql(self.table)
 *             if self._where is not None:
 */
        }
        __pyx_L7_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        /*except:*/ {
          __Pyx_AddTraceback("sweepea.Delete.__sql__", __pyx_clineno, __pyx_lineno, __pyx_filename);
          if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_3, &__pyx_t_2) < 0) __PYX_ERR(0, 2777, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_t_1 = PyTuple_Pack(3, __pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2777, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_11 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_1, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2777, __pyx_L9_except_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          if (__pyx_t_10 < 0) __PYX_ERR(0, 2777, __pyx_L9_except_error)
          __pyx_t_9 = ((!(__pyx_t_10 != 0)) != 0);
          if (__pyx_t_9) {
            __Pyx_GIVEREF(__pyx_t_4);
            __Pyx_GIVEREF(__pyx_t_3);
            __Pyx_XGIVEREF(__pyx_t_2);
            __Pyx_ErrRestoreWithState(__pyx_t_4, __pyx_t_3, __pyx_t_2);
            __pyx_t_4 = 0; __pyx_t_3 = 0; __pyx_t_2 = 0; 
            __PYX_ERR(0, 2777, __pyx_L9_except_error)
          }
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
          goto __pyx_L8_exception_handled;
        }
        __pyx_L9_except_error:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L1_error;
        __pyx_L11_try_return:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
        goto __pyx_L4_return;
        __pyx_L8_exception_handled:;
        __Pyx_PyThreadState_assign
        __Pyx_XGIVEREF(__pyx_t_6);
        __Pyx_XGIVEREF(__pyx_t_7);
        __Pyx_XGIVEREF(__pyx_t_8);
        __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
      }
    }
    /*finally:*/ {
      /*normal exit:*/{
        if (__pyx_t_5) {
          __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__85, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2777, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        }
        goto __pyx_L6;
      }
      __pyx_L4_return: {
        __pyx_t_8 = __pyx_r;
        __pyx_r = 0;
        if (__pyx_t_5) {
          __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__86, NULL);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2777, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        }
        __pyx_r = __pyx_t_8;
        __pyx_t_8 = 0;
        goto __pyx_L0;
      }
      __pyx_L6:;
    }
    goto __pyx_L19;
    __pyx_L3_error:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L1_error;
    __pyx_L19:;
  }

  /* "sweepea.pyx":2774
 *         self._where = reduce(operator.and_, expressions)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         super(Delete, self).__sql__(ctx)
 * 
 */

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

/* "sweepea.pyx":2783
 *             return self.apply_ordering(ctx)
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         database.execute(self)
 *         return database.changes()
 */

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_6Delete_7execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_7sweepea_6Delete_7execute = {"execute", (PyCFunction)__pyx_pw_7sweepea_6Delete_7execute, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_7sweepea_6Delete_7execute(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  struct __pyx_obj_7sweepea_Database *__pyx_v_database = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("execute (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_database,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_database)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, 1); __PYX_ERR(0, 2783, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "execute") < 0)) __PYX_ERR(0, 2783, __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_database = ((struct __pyx_obj_7sweepea_Database *)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("execute", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 2783, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("sweepea.Delete.execute", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_database), __pyx_ptype_7sweepea_Database, 1, "database", 0))) __PYX_ERR(0, 2783, __pyx_L1_error)
  __pyx_r = __pyx_pf_7sweepea_6Delete_6execute(__pyx_self, __pyx_v_self, __pyx_v_database);

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

static PyObject *__pyx_pf_7sweepea_6Delete_6execute(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, struct __pyx_obj_7sweepea_Database *__pyx_v_database) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("execute", 0);

  /* "sweepea.pyx":2784
 * 
 *     def execute(self, Database database):
 *         database.execute(self)             # <<<<<<<<<<<<<<
 *         return database.changes()
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_database->__pyx_vtab)->execute(__pyx_v_database, __pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2785
 *     def execute(self, Database database):
 *         database.execute(self)
 *         return database.changes()             # <<<<<<<<<<<<<<
 * 
 * SQLITE_DATETIME_FORMATS = (
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_7sweepea_Database *)__pyx_v_database->__pyx_vtab)->changes(__pyx_v_database); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "sweepea.pyx":2783
 *             return self.apply_ordering(ctx)
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         database.execute(self)
 *         return database.changes()
 */

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

/* "sweepea.pyx":2805
 *     '%Y-%m-%d %H:%M:%S.%f')
 * 
 * cpdef format_datetime(date_value):             # <<<<<<<<<<<<<<
 *     for date_format in SQLITE_DATETIME_FORMATS:
 *         try:
 */

static PyObject *__pyx_pw_7sweepea_25format_datetime(PyObject *__pyx_self, PyObject *__pyx_v_date_value); /*proto*/
static PyObject *__pyx_f_7sweepea_format_datetime(PyObject *__pyx_v_date_value, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_date_format = 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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("format_datetime", 0);

  /* "sweepea.pyx":2806
 * 
 * cpdef format_datetime(date_value):
 *     for date_format in SQLITE_DATETIME_FORMATS:             # <<<<<<<<<<<<<<
 *         try:
 *             return datetime.datetime.strptime(date_value, date_format)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SQLITE_DATETIME_FORMATS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2806, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2806, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2806, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2806, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2806, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2806, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        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, 2806, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_date_format, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "sweepea.pyx":2807
 * cpdef format_datetime(date_value):
 *     for date_format in SQLITE_DATETIME_FORMATS:
 *         try:             # <<<<<<<<<<<<<<
 *             return datetime.datetime.strptime(date_value, date_format)
 *         except ValueError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "sweepea.pyx":2808
 *     for date_format in SQLITE_DATETIME_FORMATS:
 *         try:
 *             return datetime.datetime.strptime(date_value, date_format)             # <<<<<<<<<<<<<<
 *         except ValueError:
 *             pass
 */
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime), __pyx_n_s_strptime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2808, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = NULL;
        __pyx_t_10 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
            __pyx_t_10 = 1;
          }
        }
        __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2808, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_INCREF(__pyx_v_date_value);
        __Pyx_GIVEREF(__pyx_v_date_value);
        PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_date_value);
        __Pyx_INCREF(__pyx_v_date_format);
        __Pyx_GIVEREF(__pyx_v_date_format);
        PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_date_format);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2808, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L9_try_return;

        /* "sweepea.pyx":2807
 * cpdef format_datetime(date_value):
 *     for date_format in SQLITE_DATETIME_FORMATS:
 *         try:             # <<<<<<<<<<<<<<
 *             return datetime.datetime.strptime(date_value, date_format)
 *         except ValueError:
 */
      }
      __pyx_L5_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "sweepea.pyx":2809
 *         try:
 *             return datetime.datetime.strptime(date_value, date_format)
 *         except ValueError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
      __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
      if (__pyx_t_12) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;

      /* "sweepea.pyx":2807
 * cpdef format_datetime(date_value):
 *     for date_format in SQLITE_DATETIME_FORMATS:
 *         try:             # <<<<<<<<<<<<<<
 *             return datetime.datetime.strptime(date_value, date_format)
 *         except ValueError:
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L9_try_return:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
      __pyx_L6_exception_handled:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    }

    /* "sweepea.pyx":2806
 * 
 * cpdef format_datetime(date_value):
 *     for date_format in SQLITE_DATETIME_FORMATS:             # <<<<<<<<<<<<<<
 *         try:
 *             return datetime.datetime.strptime(date_value, date_format)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2805
 *     '%Y-%m-%d %H:%M:%S.%f')
 * 
 * cpdef format_datetime(date_value):             # <<<<<<<<<<<<<<
 *     for date_format in SQLITE_DATETIME_FORMATS:
 *         try:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("sweepea.format_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_date_format);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_25format_datetime(PyObject *__pyx_self, PyObject *__pyx_v_date_value); /*proto*/
static PyObject *__pyx_pw_7sweepea_25format_datetime(PyObject *__pyx_self, PyObject *__pyx_v_date_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format_datetime (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_24format_datetime(__pyx_self, ((PyObject *)__pyx_v_date_value));

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

static PyObject *__pyx_pf_7sweepea_24format_datetime(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("format_datetime", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_format_datetime(__pyx_v_date_value, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2805, __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("sweepea.format_datetime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2812
 *             pass
 * 
 * cpdef format_date(date_value):             # <<<<<<<<<<<<<<
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_DATE_FORMATS:
 */

static PyObject *__pyx_pw_7sweepea_27format_date(PyObject *__pyx_self, PyObject *__pyx_v_date_value); /*proto*/
static PyObject *__pyx_f_7sweepea_format_date(PyObject *__pyx_v_date_value, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyDateTime_DateTime *__pyx_v_date_obj = 0;
  PyObject *__pyx_v_date_format = 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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("format_date", 0);

  /* "sweepea.pyx":2814
 * cpdef format_date(date_value):
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_DATE_FORMATS:             # <<<<<<<<<<<<<<
 *         try:
 *             date_obj = datetime.datetime.strptime(date_value, date_format)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SQLITE_DATE_FORMATS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2814, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2814, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2814, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2814, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2814, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2814, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2814, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        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, 2814, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_date_format, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "sweepea.pyx":2815
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_DATE_FORMATS:
 *         try:             # <<<<<<<<<<<<<<
 *             date_obj = datetime.datetime.strptime(date_value, date_format)
 *         except ValueError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "sweepea.pyx":2816
 *     for date_format in SQLITE_DATE_FORMATS:
 *         try:
 *             date_obj = datetime.datetime.strptime(date_value, date_format)             # <<<<<<<<<<<<<<
 *         except ValueError:
 *             pass
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime), __pyx_n_s_strptime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2816, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = NULL;
        __pyx_t_10 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
            __pyx_t_10 = 1;
          }
        }
        __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2816, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_INCREF(__pyx_v_date_value);
        __Pyx_GIVEREF(__pyx_v_date_value);
        PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_date_value);
        __Pyx_INCREF(__pyx_v_date_format);
        __Pyx_GIVEREF(__pyx_v_date_format);
        PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_date_format);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2816, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(0, 2816, __pyx_L5_error)
        __Pyx_XDECREF_SET(__pyx_v_date_obj, ((PyDateTime_DateTime *)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "sweepea.pyx":2815
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_DATE_FORMATS:
 *         try:             # <<<<<<<<<<<<<<
 *             date_obj = datetime.datetime.strptime(date_value, date_format)
 *         except ValueError:
 */
      }

      /* "sweepea.pyx":2820
 *             pass
 *         else:
 *             return date_obj.date()             # <<<<<<<<<<<<<<
 * 
 * cpdef format_time(time_value):
 */
      /*else:*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_date_obj), __pyx_n_s_date); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2820, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_11 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        if (__pyx_t_11) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2820, __pyx_L7_except_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2820, __pyx_L7_except_error)
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L8_except_return;
      }
      __pyx_L5_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "sweepea.pyx":2817
 *         try:
 *             date_obj = datetime.datetime.strptime(date_value, date_format)
 *         except ValueError:             # <<<<<<<<<<<<<<
 *             pass
 *         else:
 */
      __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
      if (__pyx_t_12) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;

      /* "sweepea.pyx":2815
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_DATE_FORMATS:
 *         try:             # <<<<<<<<<<<<<<
 *             date_obj = datetime.datetime.strptime(date_value, date_format)
 *         except ValueError:
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L8_except_return:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
      __pyx_L6_exception_handled:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    }

    /* "sweepea.pyx":2814
 * cpdef format_date(date_value):
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_DATE_FORMATS:             # <<<<<<<<<<<<<<
 *         try:
 *             date_obj = datetime.datetime.strptime(date_value, date_format)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2812
 *             pass
 * 
 * cpdef format_date(date_value):             # <<<<<<<<<<<<<<
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_DATE_FORMATS:
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("sweepea.format_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_date_obj);
  __Pyx_XDECREF(__pyx_v_date_format);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_27format_date(PyObject *__pyx_self, PyObject *__pyx_v_date_value); /*proto*/
static PyObject *__pyx_pw_7sweepea_27format_date(PyObject *__pyx_self, PyObject *__pyx_v_date_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format_date (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_26format_date(__pyx_self, ((PyObject *)__pyx_v_date_value));

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

static PyObject *__pyx_pf_7sweepea_26format_date(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_date_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("format_date", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_format_date(__pyx_v_date_value, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2812, __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("sweepea.format_date", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "sweepea.pyx":2822
 *             return date_obj.date()
 * 
 * cpdef format_time(time_value):             # <<<<<<<<<<<<<<
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_TIME_FORMATS:
 */

static PyObject *__pyx_pw_7sweepea_29format_time(PyObject *__pyx_self, PyObject *__pyx_v_time_value); /*proto*/
static PyObject *__pyx_f_7sweepea_format_time(PyObject *__pyx_v_time_value, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyDateTime_DateTime *__pyx_v_date_obj = 0;
  PyObject *__pyx_v_date_format = 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;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("format_time", 0);

  /* "sweepea.pyx":2824
 * cpdef format_time(time_value):
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_TIME_FORMATS:             # <<<<<<<<<<<<<<
 *         try:
 *             date_obj = datetime.datetime.strptime(time_value, date_format)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SQLITE_TIME_FORMATS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2824, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2824, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2824, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 2824, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2824, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        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, 2824, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_date_format, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "sweepea.pyx":2825
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_TIME_FORMATS:
 *         try:             # <<<<<<<<<<<<<<
 *             date_obj = datetime.datetime.strptime(time_value, date_format)
 *         except ValueError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_7);
      /*try:*/ {

        /* "sweepea.pyx":2826
 *     for date_format in SQLITE_TIME_FORMATS:
 *         try:
 *             date_obj = datetime.datetime.strptime(time_value, date_format)             # <<<<<<<<<<<<<<
 *         except ValueError:
 *             pass
 */
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_7cpython_8datetime_datetime), __pyx_n_s_strptime); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2826, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_9 = NULL;
        __pyx_t_10 = 0;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_9)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_9);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
            __pyx_t_10 = 1;
          }
        }
        __pyx_t_11 = PyTuple_New(2+__pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 2826, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (__pyx_t_9) {
          __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
        }
        __Pyx_INCREF(__pyx_v_time_value);
        __Pyx_GIVEREF(__pyx_v_time_value);
        PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_10, __pyx_v_time_value);
        __Pyx_INCREF(__pyx_v_date_format);
        __Pyx_GIVEREF(__pyx_v_date_format);
        PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_10, __pyx_v_date_format);
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2826, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_7cpython_8datetime_datetime))))) __PYX_ERR(0, 2826, __pyx_L5_error)
        __Pyx_XDECREF_SET(__pyx_v_date_obj, ((PyDateTime_DateTime *)__pyx_t_1));
        __pyx_t_1 = 0;

        /* "sweepea.pyx":2825
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_TIME_FORMATS:
 *         try:             # <<<<<<<<<<<<<<
 *             date_obj = datetime.datetime.strptime(time_value, date_format)
 *         except ValueError:
 */
      }

      /* "sweepea.pyx":2830
 *             pass
 *         else:
 *             return date_obj.time()             # <<<<<<<<<<<<<<
 * 
 * 
 */
      /*else:*/ {
        __Pyx_XDECREF(__pyx_r);
        __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_date_obj), __pyx_n_s_time); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2830, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_11 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        if (__pyx_t_11) {
          __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2830, __pyx_L7_except_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        } else {
          __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2830, __pyx_L7_except_error)
        }
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_r = __pyx_t_1;
        __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        goto __pyx_L8_except_return;
      }
      __pyx_L5_error:;
      __Pyx_PyThreadState_assign
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "sweepea.pyx":2827
 *         try:
 *             date_obj = datetime.datetime.strptime(time_value, date_format)
 *         except ValueError:             # <<<<<<<<<<<<<<
 *             pass
 *         else:
 */
      __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
      if (__pyx_t_12) {
        __Pyx_ErrRestore(0,0,0);
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;

      /* "sweepea.pyx":2825
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_TIME_FORMATS:
 *         try:             # <<<<<<<<<<<<<<
 *             date_obj = datetime.datetime.strptime(time_value, date_format)
 *         except ValueError:
 */
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L1_error;
      __pyx_L8_except_return:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
      goto __pyx_L0;
      __pyx_L6_exception_handled:;
      __Pyx_PyThreadState_assign
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_XGIVEREF(__pyx_t_7);
      __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    }

    /* "sweepea.pyx":2824
 * cpdef format_time(time_value):
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_TIME_FORMATS:             # <<<<<<<<<<<<<<
 *         try:
 *             date_obj = datetime.datetime.strptime(time_value, date_format)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2822
 *             return date_obj.date()
 * 
 * cpdef format_time(time_value):             # <<<<<<<<<<<<<<
 *     cdef datetime.datetime date_obj
 *     for date_format in SQLITE_TIME_FORMATS:
 */

  /* 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_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("sweepea.format_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_date_obj);
  __Pyx_XDECREF(__pyx_v_date_format);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_7sweepea_29format_time(PyObject *__pyx_self, PyObject *__pyx_v_time_value); /*proto*/
static PyObject *__pyx_pw_7sweepea_29format_time(PyObject *__pyx_self, PyObject *__pyx_v_time_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("format_time (wrapper)", 0);
  __pyx_r = __pyx_pf_7sweepea_28format_time(__pyx_self, ((PyObject *)__pyx_v_time_value));

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

static PyObject *__pyx_pf_7sweepea_28format_time(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_time_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("format_time", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_7sweepea_format_time(__pyx_v_time_value, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2822, __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("sweepea.format_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":104
 * # Datetime C API initialization function.
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime():             # <<<<<<<<<<<<<<
 *     PyDateTime_IMPORT
 * 
 */

static CYTHON_INLINE void __pyx_f_7cpython_8datetime_import_datetime(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("import_datetime", 0);

  /* "datetime.pxd":105
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime():
 *     PyDateTime_IMPORT             # <<<<<<<<<<<<<<
 * 
 * # Create date object using DateTime CAPI factory function.
 */
  PyDateTime_IMPORT;

  /* "datetime.pxd":104
 * # Datetime C API initialization function.
 * # You have to call it before any usage of DateTime CAPI functions.
 * cdef inline void import_datetime():             # <<<<<<<<<<<<<<
 *     PyDateTime_IMPORT
 * 
 */

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

/* "datetime.pxd":109
 * # Create date object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object date_new(int year, int month, int day):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_date_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("date_new", 0);

  /* "datetime.pxd":110
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object date_new(int year, int month, int day):
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)             # <<<<<<<<<<<<<<
 * 
 * # Create time object using DateTime CAPI factory function
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTimeAPI->Date_FromDate(__pyx_v_year, __pyx_v_month, __pyx_v_day, PyDateTimeAPI->DateType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "datetime.pxd":109
 * # Create date object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object date_new(int year, int month, int day):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Date_FromDate(year, month, day, PyDateTimeAPI.DateType)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.date_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":114
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object time_new(int hour, int minute, int second, int microsecond, object tz):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Time_FromTime(hour, minute, second, microsecond, tz, PyDateTimeAPI.TimeType)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_time_new(int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("time_new", 0);

  /* "datetime.pxd":115
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object time_new(int hour, int minute, int second, int microsecond, object tz):
 *     return PyDateTimeAPI.Time_FromTime(hour, minute, second, microsecond, tz, PyDateTimeAPI.TimeType)             # <<<<<<<<<<<<<<
 * 
 * # Create datetime object using DateTime CAPI factory function.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTimeAPI->Time_FromTime(__pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, PyDateTimeAPI->TimeType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "datetime.pxd":114
 * # Create time object using DateTime CAPI factory function
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object time_new(int hour, int minute, int second, int microsecond, object tz):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Time_FromTime(hour, minute, second, microsecond, tz, PyDateTimeAPI.TimeType)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.time_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":119
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromDateAndTime(year, month, day, hour, minute, second, microsecond, tz, PyDateTimeAPI.DateTimeType)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_datetime_new(int __pyx_v_year, int __pyx_v_month, int __pyx_v_day, int __pyx_v_hour, int __pyx_v_minute, int __pyx_v_second, int __pyx_v_microsecond, PyObject *__pyx_v_tz) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("datetime_new", 0);

  /* "datetime.pxd":120
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz):
 *     return PyDateTimeAPI.DateTime_FromDateAndTime(year, month, day, hour, minute, second, microsecond, tz, PyDateTimeAPI.DateTimeType)             # <<<<<<<<<<<<<<
 * 
 * # Create timedelta object using DateTime CAPI factory function.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTimeAPI->DateTime_FromDateAndTime(__pyx_v_year, __pyx_v_month, __pyx_v_day, __pyx_v_hour, __pyx_v_minute, __pyx_v_second, __pyx_v_microsecond, __pyx_v_tz, PyDateTimeAPI->DateTimeType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "datetime.pxd":119
 * # Create datetime object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object datetime_new(int year, int month, int day, int hour, int minute, int second, int microsecond, object tz):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.DateTime_FromDateAndTime(year, month, day, hour, minute, second, microsecond, tz, PyDateTimeAPI.DateTimeType)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.datetime_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":124
 * # Create timedelta object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object timedelta_new(int days, int seconds, int useconds):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_timedelta_new(int __pyx_v_days, int __pyx_v_seconds, int __pyx_v_useconds) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("timedelta_new", 0);

  /* "datetime.pxd":125
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object timedelta_new(int days, int seconds, int useconds):
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)             # <<<<<<<<<<<<<<
 * 
 * # More recognizable getters for date/time/datetime/timedelta.
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyDateTimeAPI->Delta_FromDelta(__pyx_v_days, __pyx_v_seconds, __pyx_v_useconds, 1, PyDateTimeAPI->DeltaType); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "datetime.pxd":124
 * # Create timedelta object using DateTime CAPI factory function.
 * # Note, there are no range checks for any of the arguments.
 * cdef inline object timedelta_new(int days, int seconds, int useconds):             # <<<<<<<<<<<<<<
 *     return PyDateTimeAPI.Delta_FromDelta(days, seconds, useconds, 1, PyDateTimeAPI.DeltaType)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cpython.datetime.timedelta_new", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "datetime.pxd":133
 * 
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     if (<PyDateTime_Time*>o).hastzinfo:
 *         return <object>(<PyDateTime_Time*>o).tzinfo
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_time_tzinfo(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("time_tzinfo", 0);

  /* "datetime.pxd":134
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):
 *     if (<PyDateTime_Time*>o).hastzinfo:             # <<<<<<<<<<<<<<
 *         return <object>(<PyDateTime_Time*>o).tzinfo
 *     else:
 */
  __pyx_t_1 = (((PyDateTime_Time *)__pyx_v_o)->hastzinfo != 0);
  if (__pyx_t_1) {

    /* "datetime.pxd":135
 * cdef inline object time_tzinfo(object o):
 *     if (<PyDateTime_Time*>o).hastzinfo:
 *         return <object>(<PyDateTime_Time*>o).tzinfo             # <<<<<<<<<<<<<<
 *     else:
 *         return None
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)((PyDateTime_Time *)__pyx_v_o)->tzinfo));
    __pyx_r = ((PyObject *)((PyDateTime_Time *)__pyx_v_o)->tzinfo);
    goto __pyx_L0;

    /* "datetime.pxd":134
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):
 *     if (<PyDateTime_Time*>o).hastzinfo:             # <<<<<<<<<<<<<<
 *         return <object>(<PyDateTime_Time*>o).tzinfo
 *     else:
 */
  }

  /* "datetime.pxd":137
 *         return <object>(<PyDateTime_Time*>o).tzinfo
 *     else:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * # Get tzinfo of datetime
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }

  /* "datetime.pxd":133
 * 
 * # Get tzinfo of time
 * cdef inline object time_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     if (<PyDateTime_Time*>o).hastzinfo:
 *         return <object>(<PyDateTime_Time*>o).tzinfo
 */

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

/* "datetime.pxd":140
 * 
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     if (<PyDateTime_DateTime*>o).hastzinfo:
 *         return <object>(<PyDateTime_DateTime*>o).tzinfo
 */

static CYTHON_INLINE PyObject *__pyx_f_7cpython_8datetime_datetime_tzinfo(PyObject *__pyx_v_o) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("datetime_tzinfo", 0);

  /* "datetime.pxd":141
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):
 *     if (<PyDateTime_DateTime*>o).hastzinfo:             # <<<<<<<<<<<<<<
 *         return <object>(<PyDateTime_DateTime*>o).tzinfo
 *     else:
 */
  __pyx_t_1 = (((PyDateTime_DateTime *)__pyx_v_o)->hastzinfo != 0);
  if (__pyx_t_1) {

    /* "datetime.pxd":142
 * cdef inline object datetime_tzinfo(object o):
 *     if (<PyDateTime_DateTime*>o).hastzinfo:
 *         return <object>(<PyDateTime_DateTime*>o).tzinfo             # <<<<<<<<<<<<<<
 *     else:
 *         return None
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)((PyDateTime_DateTime *)__pyx_v_o)->tzinfo));
    __pyx_r = ((PyObject *)((PyDateTime_DateTime *)__pyx_v_o)->tzinfo);
    goto __pyx_L0;

    /* "datetime.pxd":141
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):
 *     if (<PyDateTime_DateTime*>o).hastzinfo:             # <<<<<<<<<<<<<<
 *         return <object>(<PyDateTime_DateTime*>o).tzinfo
 *     else:
 */
  }

  /* "datetime.pxd":144
 *         return <object>(<PyDateTime_DateTime*>o).tzinfo
 *     else:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * # Get year of date
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }

  /* "datetime.pxd":140
 * 
 * # Get tzinfo of datetime
 * cdef inline object datetime_tzinfo(object o):             # <<<<<<<<<<<<<<
 *     if (<PyDateTime_DateTime*>o).hastzinfo:
 *         return <object>(<PyDateTime_DateTime*>o).tzinfo
 */

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

/* "datetime.pxd":147
 * 
 * # Get year of date
 * cdef inline int date_year(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_year(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date_year", 0);

  /* "datetime.pxd":148
 * # Get year of date
 * cdef inline int date_year(object o):
 *     return PyDateTime_GET_YEAR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get month of date
 */
  __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":147
 * 
 * # Get year of date
 * cdef inline int date_year(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

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

/* "datetime.pxd":151
 * 
 * # Get month of date
 * cdef inline int date_month(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_month(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date_month", 0);

  /* "datetime.pxd":152
 * # Get month of date
 * cdef inline int date_month(object o):
 *     return PyDateTime_GET_MONTH(o)             # <<<<<<<<<<<<<<
 * 
 * # Get day of date
 */
  __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":151
 * 
 * # Get month of date
 * cdef inline int date_month(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

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

/* "datetime.pxd":155
 * 
 * # Get day of date
 * cdef inline int date_day(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_date_day(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("date_day", 0);

  /* "datetime.pxd":156
 * # Get day of date
 * cdef inline int date_day(object o):
 *     return PyDateTime_GET_DAY(o)             # <<<<<<<<<<<<<<
 * 
 * # Get year of datetime
 */
  __pyx_r = PyDateTime_GET_DAY(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":155
 * 
 * # Get day of date
 * cdef inline int date_day(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

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

/* "datetime.pxd":159
 * 
 * # Get year of datetime
 * cdef inline int datetime_year(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_year(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_year", 0);

  /* "datetime.pxd":160
 * # Get year of datetime
 * cdef inline int datetime_year(object o):
 *     return PyDateTime_GET_YEAR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get month of datetime
 */
  __pyx_r = PyDateTime_GET_YEAR(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":159
 * 
 * # Get year of datetime
 * cdef inline int datetime_year(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_YEAR(o)
 * 
 */

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

/* "datetime.pxd":163
 * 
 * # Get month of datetime
 * cdef inline int datetime_month(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_month(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_month", 0);

  /* "datetime.pxd":164
 * # Get month of datetime
 * cdef inline int datetime_month(object o):
 *     return PyDateTime_GET_MONTH(o)             # <<<<<<<<<<<<<<
 * 
 * # Get day of datetime
 */
  __pyx_r = PyDateTime_GET_MONTH(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":163
 * 
 * # Get month of datetime
 * cdef inline int datetime_month(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_MONTH(o)
 * 
 */

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

/* "datetime.pxd":167
 * 
 * # Get day of datetime
 * cdef inline int datetime_day(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_day(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_day", 0);

  /* "datetime.pxd":168
 * # Get day of datetime
 * cdef inline int datetime_day(object o):
 *     return PyDateTime_GET_DAY(o)             # <<<<<<<<<<<<<<
 * 
 * # Get hour of time
 */
  __pyx_r = PyDateTime_GET_DAY(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":167
 * 
 * # Get day of datetime
 * cdef inline int datetime_day(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_GET_DAY(o)
 * 
 */

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

/* "datetime.pxd":171
 * 
 * # Get hour of time
 * cdef inline int time_hour(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_HOUR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_hour(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time_hour", 0);

  /* "datetime.pxd":172
 * # Get hour of time
 * cdef inline int time_hour(object o):
 *     return PyDateTime_TIME_GET_HOUR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get minute of time
 */
  __pyx_r = PyDateTime_TIME_GET_HOUR(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":171
 * 
 * # Get hour of time
 * cdef inline int time_hour(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_HOUR(o)
 * 
 */

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

/* "datetime.pxd":175
 * 
 * # Get minute of time
 * cdef inline int time_minute(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MINUTE(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_minute(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time_minute", 0);

  /* "datetime.pxd":176
 * # Get minute of time
 * cdef inline int time_minute(object o):
 *     return PyDateTime_TIME_GET_MINUTE(o)             # <<<<<<<<<<<<<<
 * 
 * # Get second of time
 */
  __pyx_r = PyDateTime_TIME_GET_MINUTE(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":175
 * 
 * # Get minute of time
 * cdef inline int time_minute(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MINUTE(o)
 * 
 */

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

/* "datetime.pxd":179
 * 
 * # Get second of time
 * cdef inline int time_second(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_SECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_second(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time_second", 0);

  /* "datetime.pxd":180
 * # Get second of time
 * cdef inline int time_second(object o):
 *     return PyDateTime_TIME_GET_SECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microsecond of time
 */
  __pyx_r = PyDateTime_TIME_GET_SECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":179
 * 
 * # Get second of time
 * cdef inline int time_second(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_SECOND(o)
 * 
 */

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

/* "datetime.pxd":183
 * 
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MICROSECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_time_microsecond(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time_microsecond", 0);

  /* "datetime.pxd":184
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o):
 *     return PyDateTime_TIME_GET_MICROSECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get hour of datetime
 */
  __pyx_r = PyDateTime_TIME_GET_MICROSECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":183
 * 
 * # Get microsecond of time
 * cdef inline int time_microsecond(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_TIME_GET_MICROSECOND(o)
 * 
 */

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

/* "datetime.pxd":187
 * 
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_HOUR(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_hour(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_hour", 0);

  /* "datetime.pxd":188
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o):
 *     return PyDateTime_DATE_GET_HOUR(o)             # <<<<<<<<<<<<<<
 * 
 * # Get minute of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_HOUR(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":187
 * 
 * # Get hour of datetime
 * cdef inline int datetime_hour(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_HOUR(o)
 * 
 */

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

/* "datetime.pxd":191
 * 
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MINUTE(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_minute(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_minute", 0);

  /* "datetime.pxd":192
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o):
 *     return PyDateTime_DATE_GET_MINUTE(o)             # <<<<<<<<<<<<<<
 * 
 * # Get second of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_MINUTE(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":191
 * 
 * # Get minute of datetime
 * cdef inline int datetime_minute(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MINUTE(o)
 * 
 */

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

/* "datetime.pxd":195
 * 
 * # Get second of datetime
 * cdef inline int datetime_second(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_SECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_second(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_second", 0);

  /* "datetime.pxd":196
 * # Get second of datetime
 * cdef inline int datetime_second(object o):
 *     return PyDateTime_DATE_GET_SECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get microsecond of datetime
 */
  __pyx_r = PyDateTime_DATE_GET_SECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":195
 * 
 * # Get second of datetime
 * cdef inline int datetime_second(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_SECOND(o)
 * 
 */

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

/* "datetime.pxd":199
 * 
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MICROSECOND(o)
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_datetime_microsecond(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("datetime_microsecond", 0);

  /* "datetime.pxd":200
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o):
 *     return PyDateTime_DATE_GET_MICROSECOND(o)             # <<<<<<<<<<<<<<
 * 
 * # Get days of timedelta
 */
  __pyx_r = PyDateTime_DATE_GET_MICROSECOND(__pyx_v_o);
  goto __pyx_L0;

  /* "datetime.pxd":199
 * 
 * # Get microsecond of datetime
 * cdef inline int datetime_microsecond(object o):             # <<<<<<<<<<<<<<
 *     return PyDateTime_DATE_GET_MICROSECOND(o)
 * 
 */

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

/* "datetime.pxd":203
 * 
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o):             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).days
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_days(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timedelta_days", 0);

  /* "datetime.pxd":204
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o):
 *     return (<PyDateTime_Delta*>o).days             # <<<<<<<<<<<<<<
 * 
 * # Get seconds of timedelta
 */
  __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->days;
  goto __pyx_L0;

  /* "datetime.pxd":203
 * 
 * # Get days of timedelta
 * cdef inline int timedelta_days(object o):             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).days
 * 
 */

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

/* "datetime.pxd":207
 * 
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o):             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).seconds
 * 
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_seconds(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timedelta_seconds", 0);

  /* "datetime.pxd":208
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o):
 *     return (<PyDateTime_Delta*>o).seconds             # <<<<<<<<<<<<<<
 * 
 * # Get microseconds of timedelta
 */
  __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->seconds;
  goto __pyx_L0;

  /* "datetime.pxd":207
 * 
 * # Get seconds of timedelta
 * cdef inline int timedelta_seconds(object o):             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).seconds
 * 
 */

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

/* "datetime.pxd":211
 * 
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o):             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).microseconds
 */

static CYTHON_INLINE int __pyx_f_7cpython_8datetime_timedelta_microseconds(PyObject *__pyx_v_o) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timedelta_microseconds", 0);

  /* "datetime.pxd":212
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o):
 *     return (<PyDateTime_Delta*>o).microseconds             # <<<<<<<<<<<<<<
 */
  __pyx_r = ((PyDateTime_Delta *)__pyx_v_o)->microseconds;
  goto __pyx_L0;

  /* "datetime.pxd":211
 * 
 * # Get microseconds of timedelta
 * cdef inline int timedelta_microseconds(object o):             # <<<<<<<<<<<<<<
 *     return (<PyDateTime_Delta*>o).microseconds
 */

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

/* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_object____CursorWrapper____tuple___to_py")
 * cdef object __Pyx_CFunc_object____CursorWrapper____tuple___to_py(object (*f)(CursorWrapper, tuple) ):
 *     def wrap(CursorWrapper cursor_wrapper, tuple row):             # <<<<<<<<<<<<<<
 *         """wrap(cursor_wrapper: 'CursorWrapper', row: tuple)"""
 *         return f(cursor_wrapper, row)
 */

/* Python wrapper */
static PyObject *__pyx_pw_11cfunc_dot_to_py_52__Pyx_CFunc_object____CursorWrapper____tuple___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_11cfunc_dot_to_py_52__Pyx_CFunc_object____CursorWrapper____tuple___to_py_wrap[] = "wrap(cursor_wrapper: 'CursorWrapper', row: tuple)";
static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_52__Pyx_CFunc_object____CursorWrapper____tuple___to_py_1wrap = {"wrap", (PyCFunction)__pyx_pw_11cfunc_dot_to_py_52__Pyx_CFunc_object____CursorWrapper____tuple___to_py_1wrap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11cfunc_dot_to_py_52__Pyx_CFunc_object____CursorWrapper____tuple___to_py_wrap};
static PyObject *__pyx_pw_11cfunc_dot_to_py_52__Pyx_CFunc_object____CursorWrapper____tuple___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_cursor_wrapper = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wrap (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cursor_wrapper,&__pyx_n_s_row,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_cursor_wrapper)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("wrap", 1, 2, 2, 1); __PYX_ERR(2, 65, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wrap") < 0)) __PYX_ERR(2, 65, __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_cursor_wrapper = ((struct __pyx_obj_7sweepea_CursorWrapper *)values[0]);
    __pyx_v_row = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("wrap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 65, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____CursorWrapper____tuple___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cursor_wrapper), __pyx_ptype_7sweepea_CursorWrapper, 1, "cursor_wrapper", 0))) __PYX_ERR(2, 65, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_row), (&PyTuple_Type), 1, "row", 1))) __PYX_ERR(2, 65, __pyx_L1_error)
  __pyx_r = __pyx_pf_11cfunc_dot_to_py_52__Pyx_CFunc_object____CursorWrapper____tuple___to_py_wrap(__pyx_self, __pyx_v_cursor_wrapper, __pyx_v_row);

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

static PyObject *__pyx_pf_11cfunc_dot_to_py_52__Pyx_CFunc_object____CursorWrapper____tuple___to_py_wrap(PyObject *__pyx_self, struct __pyx_obj_7sweepea_CursorWrapper *__pyx_v_cursor_wrapper, PyObject *__pyx_v_row) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py *__pyx_cur_scope;
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("wrap", 0);
  __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cfunc.to_py":67
 *     def wrap(CursorWrapper cursor_wrapper, tuple row):
 *         """wrap(cursor_wrapper: 'CursorWrapper', row: tuple)"""
 *         return f(cursor_wrapper, row)             # <<<<<<<<<<<<<<
 *     return wrap
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_cursor_wrapper, __pyx_v_row); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_object____CursorWrapper____tuple___to_py")
 * cdef object __Pyx_CFunc_object____CursorWrapper____tuple___to_py(object (*f)(CursorWrapper, tuple) ):
 *     def wrap(CursorWrapper cursor_wrapper, tuple row):             # <<<<<<<<<<<<<<
 *         """wrap(cursor_wrapper: 'CursorWrapper', row: tuple)"""
 *         return f(cursor_wrapper, row)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____CursorWrapper____tuple___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_object____CursorWrapper____tuple___to_py")
 * cdef object __Pyx_CFunc_object____CursorWrapper____tuple___to_py(object (*f)(CursorWrapper, tuple) ):             # <<<<<<<<<<<<<<
 *     def wrap(CursorWrapper cursor_wrapper, tuple row):
 *         """wrap(cursor_wrapper: 'CursorWrapper', row: tuple)"""
 */

static PyObject *__Pyx_CFunc_object____CursorWrapper____tuple___to_py(PyObject *(*__pyx_v_f)(struct __pyx_obj_7sweepea_CursorWrapper *, PyObject *)) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py *__pyx_cur_scope;
  PyObject *__pyx_v_wrap = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__Pyx_CFunc_object____CursorWrapper____tuple___to_py", 0);
  __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return 0;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_f = __pyx_v_f;

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_object____CursorWrapper____tuple___to_py")
 * cdef object __Pyx_CFunc_object____CursorWrapper____tuple___to_py(object (*f)(CursorWrapper, tuple) ):
 *     def wrap(CursorWrapper cursor_wrapper, tuple row):             # <<<<<<<<<<<<<<
 *         """wrap(cursor_wrapper: 'CursorWrapper', row: tuple)"""
 *         return f(cursor_wrapper, row)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11cfunc_dot_to_py_52__Pyx_CFunc_object____CursorWrapper____tuple___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_object____CursorWrap, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__88)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_wrap = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cfunc.to_py":68
 *         """wrap(cursor_wrapper: 'CursorWrapper', row: tuple)"""
 *         return f(cursor_wrapper, row)
 *     return wrap             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_wrap);
  __pyx_r = __pyx_v_wrap;
  goto __pyx_L0;

  /* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_object____CursorWrapper____tuple___to_py")
 * cdef object __Pyx_CFunc_object____CursorWrapper____tuple___to_py(object (*f)(CursorWrapper, tuple) ):             # <<<<<<<<<<<<<<
 *     def wrap(CursorWrapper cursor_wrapper, tuple row):
 *         """wrap(cursor_wrapper: 'CursorWrapper', row: tuple)"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____CursorWrapper____tuple___to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wrap);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py")
 * cdef object __Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py(object (*f)(NamedTupleCursorWrapper, tuple) ):
 *     def wrap(NamedTupleCursorWrapper cursor_wrapper, tuple row):             # <<<<<<<<<<<<<<
 *         """wrap(cursor_wrapper: 'NamedTupleCursorWrapper', row: tuple)"""
 *         return f(cursor_wrapper, row)
 */

/* Python wrapper */
static PyObject *__pyx_pw_11cfunc_dot_to_py_62__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_11cfunc_dot_to_py_62__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py_wrap[] = "wrap(cursor_wrapper: 'NamedTupleCursorWrapper', row: tuple)";
static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_62__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py_1wrap = {"wrap", (PyCFunction)__pyx_pw_11cfunc_dot_to_py_62__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py_1wrap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11cfunc_dot_to_py_62__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py_wrap};
static PyObject *__pyx_pw_11cfunc_dot_to_py_62__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *__pyx_v_cursor_wrapper = 0;
  PyObject *__pyx_v_row = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wrap (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cursor_wrapper,&__pyx_n_s_row,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_cursor_wrapper)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_row)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("wrap", 1, 2, 2, 1); __PYX_ERR(2, 65, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wrap") < 0)) __PYX_ERR(2, 65, __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_cursor_wrapper = ((struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *)values[0]);
    __pyx_v_row = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("wrap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 65, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_cursor_wrapper), __pyx_ptype_7sweepea_NamedTupleCursorWrapper, 1, "cursor_wrapper", 0))) __PYX_ERR(2, 65, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_row), (&PyTuple_Type), 1, "row", 1))) __PYX_ERR(2, 65, __pyx_L1_error)
  __pyx_r = __pyx_pf_11cfunc_dot_to_py_62__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py_wrap(__pyx_self, __pyx_v_cursor_wrapper, __pyx_v_row);

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

static PyObject *__pyx_pf_11cfunc_dot_to_py_62__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py_wrap(PyObject *__pyx_self, struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *__pyx_v_cursor_wrapper, PyObject *__pyx_v_row) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py *__pyx_cur_scope;
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("wrap", 0);
  __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cfunc.to_py":67
 *     def wrap(NamedTupleCursorWrapper cursor_wrapper, tuple row):
 *         """wrap(cursor_wrapper: 'NamedTupleCursorWrapper', row: tuple)"""
 *         return f(cursor_wrapper, row)             # <<<<<<<<<<<<<<
 *     return wrap
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_cursor_wrapper, __pyx_v_row); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py")
 * cdef object __Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py(object (*f)(NamedTupleCursorWrapper, tuple) ):
 *     def wrap(NamedTupleCursorWrapper cursor_wrapper, tuple row):             # <<<<<<<<<<<<<<
 *         """wrap(cursor_wrapper: 'NamedTupleCursorWrapper', row: tuple)"""
 *         return f(cursor_wrapper, row)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py")
 * cdef object __Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py(object (*f)(NamedTupleCursorWrapper, tuple) ):             # <<<<<<<<<<<<<<
 *     def wrap(NamedTupleCursorWrapper cursor_wrapper, tuple row):
 *         """wrap(cursor_wrapper: 'NamedTupleCursorWrapper', row: tuple)"""
 */

static PyObject *__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py(PyObject *(*__pyx_v_f)(struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *, PyObject *)) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py *__pyx_cur_scope;
  PyObject *__pyx_v_wrap = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py", 0);
  __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return 0;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_f = __pyx_v_f;

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py")
 * cdef object __Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py(object (*f)(NamedTupleCursorWrapper, tuple) ):
 *     def wrap(NamedTupleCursorWrapper cursor_wrapper, tuple row):             # <<<<<<<<<<<<<<
 *         """wrap(cursor_wrapper: 'NamedTupleCursorWrapper', row: tuple)"""
 *         return f(cursor_wrapper, row)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11cfunc_dot_to_py_62__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_object____NamedTuple, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__90)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_wrap = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cfunc.to_py":68
 *         """wrap(cursor_wrapper: 'NamedTupleCursorWrapper', row: tuple)"""
 *         return f(cursor_wrapper, row)
 *     return wrap             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_wrap);
  __pyx_r = __pyx_v_wrap;
  goto __pyx_L0;

  /* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py")
 * cdef object __Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py(object (*f)(NamedTupleCursorWrapper, tuple) ):             # <<<<<<<<<<<<<<
 *     def wrap(NamedTupleCursorWrapper cursor_wrapper, tuple row):
 *         """wrap(cursor_wrapper: 'NamedTupleCursorWrapper', row: tuple)"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wrap);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_float____object___to_py")
 * cdef object __Pyx_CFunc_float____object___to_py(float (*f)(object) except *):
 *     def wrap(object raw_match_info):             # <<<<<<<<<<<<<<
 *         """wrap(raw_match_info) -> 'float'"""
 *         return f(raw_match_info)
 */

/* Python wrapper */
static PyObject *__pyx_pw_11cfunc_dot_to_py_35__Pyx_CFunc_float____object___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_v_raw_match_info); /*proto*/
static char __pyx_doc_11cfunc_dot_to_py_35__Pyx_CFunc_float____object___to_py_wrap[] = "wrap(raw_match_info) -> 'float'";
static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_35__Pyx_CFunc_float____object___to_py_1wrap = {"wrap", (PyCFunction)__pyx_pw_11cfunc_dot_to_py_35__Pyx_CFunc_float____object___to_py_1wrap, METH_O, __pyx_doc_11cfunc_dot_to_py_35__Pyx_CFunc_float____object___to_py_wrap};
static PyObject *__pyx_pw_11cfunc_dot_to_py_35__Pyx_CFunc_float____object___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_v_raw_match_info) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wrap (wrapper)", 0);
  __pyx_r = __pyx_pf_11cfunc_dot_to_py_35__Pyx_CFunc_float____object___to_py_wrap(__pyx_self, ((PyObject *)__pyx_v_raw_match_info));

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

static PyObject *__pyx_pf_11cfunc_dot_to_py_35__Pyx_CFunc_float____object___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_raw_match_info) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object___to_py *__pyx_cur_scope;
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object___to_py *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("wrap", 0);
  __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object___to_py *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cfunc.to_py":67
 *     def wrap(object raw_match_info):
 *         """wrap(raw_match_info) -> 'float'"""
 *         return f(raw_match_info)             # <<<<<<<<<<<<<<
 *     return wrap
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_raw_match_info); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 67, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_float____object___to_py")
 * cdef object __Pyx_CFunc_float____object___to_py(float (*f)(object) except *):
 *     def wrap(object raw_match_info):             # <<<<<<<<<<<<<<
 *         """wrap(raw_match_info) -> 'float'"""
 *         return f(raw_match_info)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_float____object___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_float____object___to_py")
 * cdef object __Pyx_CFunc_float____object___to_py(float (*f)(object) except *):             # <<<<<<<<<<<<<<
 *     def wrap(object raw_match_info):
 *         """wrap(raw_match_info) -> 'float'"""
 */

static PyObject *__Pyx_CFunc_float____object___to_py(float (*__pyx_v_f)(PyObject *)) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object___to_py *__pyx_cur_scope;
  PyObject *__pyx_v_wrap = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__Pyx_CFunc_float____object___to_py", 0);
  __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object___to_py *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_float____object___to_py(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_float____object___to_py, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return 0;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_f = __pyx_v_f;

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_float____object___to_py")
 * cdef object __Pyx_CFunc_float____object___to_py(float (*f)(object) except *):
 *     def wrap(object raw_match_info):             # <<<<<<<<<<<<<<
 *         """wrap(raw_match_info) -> 'float'"""
 *         return f(raw_match_info)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11cfunc_dot_to_py_35__Pyx_CFunc_float____object___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_float____object___to, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__92)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_wrap = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cfunc.to_py":68
 *         """wrap(raw_match_info) -> 'float'"""
 *         return f(raw_match_info)
 *     return wrap             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_wrap);
  __pyx_r = __pyx_v_wrap;
  goto __pyx_L0;

  /* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_float____object___to_py")
 * cdef object __Pyx_CFunc_float____object___to_py(float (*f)(object) except *):             # <<<<<<<<<<<<<<
 *     def wrap(object raw_match_info):
 *         """wrap(raw_match_info) -> 'float'"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_float____object___to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wrap);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_float____object____int____float____float___to_py")
 * cdef object __Pyx_CFunc_float____object____int____float____float___to_py(float (*f)(object, int, float, float) except *):
 *     def wrap(object raw_match_info, int column_index, float k1, float b):             # <<<<<<<<<<<<<<
 *         """wrap(raw_match_info, column_index: 'int', k1: 'float', b: 'float') -> 'float'"""
 *         return f(raw_match_info, column_index, k1, b)
 */

/* Python wrapper */
static PyObject *__pyx_pw_11cfunc_dot_to_py_60__Pyx_CFunc_float____object____int____float____float___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_11cfunc_dot_to_py_60__Pyx_CFunc_float____object____int____float____float___to_py_wrap[] = "wrap(raw_match_info, column_index: 'int', k1: 'float', b: 'float') -> 'float'";
static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_60__Pyx_CFunc_float____object____int____float____float___to_py_1wrap = {"wrap", (PyCFunction)__pyx_pw_11cfunc_dot_to_py_60__Pyx_CFunc_float____object____int____float____float___to_py_1wrap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11cfunc_dot_to_py_60__Pyx_CFunc_float____object____int____float____float___to_py_wrap};
static PyObject *__pyx_pw_11cfunc_dot_to_py_60__Pyx_CFunc_float____object____int____float____float___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_raw_match_info = 0;
  int __pyx_v_column_index;
  float __pyx_v_k1;
  float __pyx_v_b;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wrap (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_raw_match_info,&__pyx_n_s_column_index,&__pyx_n_s_k1,&__pyx_n_s_b,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_raw_match_info)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_column_index)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("wrap", 1, 4, 4, 1); __PYX_ERR(2, 65, __pyx_L3_error)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_k1)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("wrap", 1, 4, 4, 2); __PYX_ERR(2, 65, __pyx_L3_error)
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("wrap", 1, 4, 4, 3); __PYX_ERR(2, 65, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wrap") < 0)) __PYX_ERR(2, 65, __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_raw_match_info = values[0];
    __pyx_v_column_index = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_column_index == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 65, __pyx_L3_error)
    __pyx_v_k1 = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_k1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(2, 65, __pyx_L3_error)
    __pyx_v_b = __pyx_PyFloat_AsFloat(values[3]); if (unlikely((__pyx_v_b == (float)-1) && PyErr_Occurred())) __PYX_ERR(2, 65, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("wrap", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 65, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_float____object____int____float____float___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_11cfunc_dot_to_py_60__Pyx_CFunc_float____object____int____float____float___to_py_wrap(__pyx_self, __pyx_v_raw_match_info, __pyx_v_column_index, __pyx_v_k1, __pyx_v_b);

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

static PyObject *__pyx_pf_11cfunc_dot_to_py_60__Pyx_CFunc_float____object____int____float____float___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_raw_match_info, int __pyx_v_column_index, float __pyx_v_k1, float __pyx_v_b) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py *__pyx_cur_scope;
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  float __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("wrap", 0);
  __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cfunc.to_py":67
 *     def wrap(object raw_match_info, int column_index, float k1, float b):
 *         """wrap(raw_match_info, column_index: 'int', k1: 'float', b: 'float') -> 'float'"""
 *         return f(raw_match_info, column_index, k1, b)             # <<<<<<<<<<<<<<
 *     return wrap
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_raw_match_info, __pyx_v_column_index, __pyx_v_k1, __pyx_v_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 67, __pyx_L1_error)
  __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_float____object____int____float____float___to_py")
 * cdef object __Pyx_CFunc_float____object____int____float____float___to_py(float (*f)(object, int, float, float) except *):
 *     def wrap(object raw_match_info, int column_index, float k1, float b):             # <<<<<<<<<<<<<<
 *         """wrap(raw_match_info, column_index: 'int', k1: 'float', b: 'float') -> 'float'"""
 *         return f(raw_match_info, column_index, k1, b)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_float____object____int____float____float___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_float____object____int____float____float___to_py")
 * cdef object __Pyx_CFunc_float____object____int____float____float___to_py(float (*f)(object, int, float, float) except *):             # <<<<<<<<<<<<<<
 *     def wrap(object raw_match_info, int column_index, float k1, float b):
 *         """wrap(raw_match_info, column_index: 'int', k1: 'float', b: 'float') -> 'float'"""
 */

static PyObject *__Pyx_CFunc_float____object____int____float____float___to_py(float (*__pyx_v_f)(PyObject *, int, float, float)) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py *__pyx_cur_scope;
  PyObject *__pyx_v_wrap = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__Pyx_CFunc_float____object____int____float____float___to_py", 0);
  __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return 0;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_f = __pyx_v_f;

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_float____object____int____float____float___to_py")
 * cdef object __Pyx_CFunc_float____object____int____float____float___to_py(float (*f)(object, int, float, float) except *):
 *     def wrap(object raw_match_info, int column_index, float k1, float b):             # <<<<<<<<<<<<<<
 *         """wrap(raw_match_info, column_index: 'int', k1: 'float', b: 'float') -> 'float'"""
 *         return f(raw_match_info, column_index, k1, b)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11cfunc_dot_to_py_60__Pyx_CFunc_float____object____int____float____float___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_float____object____i, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__94)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_wrap = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cfunc.to_py":68
 *         """wrap(raw_match_info, column_index: 'int', k1: 'float', b: 'float') -> 'float'"""
 *         return f(raw_match_info, column_index, k1, b)
 *     return wrap             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_wrap);
  __pyx_r = __pyx_v_wrap;
  goto __pyx_L0;

  /* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_float____object____int____float____float___to_py")
 * cdef object __Pyx_CFunc_float____object____int____float____float___to_py(float (*f)(object, int, float, float) except *):             # <<<<<<<<<<<<<<
 *     def wrap(object raw_match_info, int column_index, float k1, float b):
 *         """wrap(raw_match_info, column_index: 'int', k1: 'float', b: 'float') -> 'float'"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_float____object____int____float____float___to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wrap);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_bint____basestring____basestring___to_py")
 * cdef object __Pyx_CFunc_bint____basestring____basestring___to_py(bint (*f)(basestring, basestring) except *):
 *     def wrap(basestring value, basestring regex):             # <<<<<<<<<<<<<<
 *         """wrap(value: basestring, regex: basestring) -> bool"""
 *         return f(value, regex)
 */

/* Python wrapper */
static PyObject *__pyx_pw_11cfunc_dot_to_py_52__Pyx_CFunc_bint____basestring____basestring___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_11cfunc_dot_to_py_52__Pyx_CFunc_bint____basestring____basestring___to_py_wrap[] = "wrap(value: basestring, regex: basestring) -> bool";
static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_52__Pyx_CFunc_bint____basestring____basestring___to_py_1wrap = {"wrap", (PyCFunction)__pyx_pw_11cfunc_dot_to_py_52__Pyx_CFunc_bint____basestring____basestring___to_py_1wrap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11cfunc_dot_to_py_52__Pyx_CFunc_bint____basestring____basestring___to_py_wrap};
static PyObject *__pyx_pw_11cfunc_dot_to_py_52__Pyx_CFunc_bint____basestring____basestring___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_regex = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("wrap (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_value,&__pyx_n_s_regex,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_value)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_regex)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("wrap", 1, 2, 2, 1); __PYX_ERR(2, 65, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wrap") < 0)) __PYX_ERR(2, 65, __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_value = ((PyObject*)values[0]);
    __pyx_v_regex = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("wrap", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 65, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_bint____basestring____basestring___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_value), (&PyBaseString_Type), 1, "value", 1))) __PYX_ERR(2, 65, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_regex), (&PyBaseString_Type), 1, "regex", 1))) __PYX_ERR(2, 65, __pyx_L1_error)
  __pyx_r = __pyx_pf_11cfunc_dot_to_py_52__Pyx_CFunc_bint____basestring____basestring___to_py_wrap(__pyx_self, __pyx_v_value, __pyx_v_regex);

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

static PyObject *__pyx_pf_11cfunc_dot_to_py_52__Pyx_CFunc_bint____basestring____basestring___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_value, PyObject *__pyx_v_regex) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py *__pyx_cur_scope;
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py *__pyx_outer_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("wrap", 0);
  __pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "cfunc.to_py":67
 *     def wrap(basestring value, basestring regex):
 *         """wrap(value: basestring, regex: basestring) -> bool"""
 *         return f(value, regex)             # <<<<<<<<<<<<<<
 *     return wrap
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_value, __pyx_v_regex); if (unlikely(PyErr_Occurred())) __PYX_ERR(2, 67, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_bint____basestring____basestring___to_py")
 * cdef object __Pyx_CFunc_bint____basestring____basestring___to_py(bint (*f)(basestring, basestring) except *):
 *     def wrap(basestring value, basestring regex):             # <<<<<<<<<<<<<<
 *         """wrap(value: basestring, regex: basestring) -> bool"""
 *         return f(value, regex)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_bint____basestring____basestring___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_bint____basestring____basestring___to_py")
 * cdef object __Pyx_CFunc_bint____basestring____basestring___to_py(bint (*f)(basestring, basestring) except *):             # <<<<<<<<<<<<<<
 *     def wrap(basestring value, basestring regex):
 *         """wrap(value: basestring, regex: basestring) -> bool"""
 */

static PyObject *__Pyx_CFunc_bint____basestring____basestring___to_py(int (*__pyx_v_f)(PyObject *, PyObject *)) {
  struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py *__pyx_cur_scope;
  PyObject *__pyx_v_wrap = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__Pyx_CFunc_bint____basestring____basestring___to_py", 0);
  __pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return 0;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  __pyx_cur_scope->__pyx_v_f = __pyx_v_f;

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_bint____basestring____basestring___to_py")
 * cdef object __Pyx_CFunc_bint____basestring____basestring___to_py(bint (*f)(basestring, basestring) except *):
 *     def wrap(basestring value, basestring regex):             # <<<<<<<<<<<<<<
 *         """wrap(value: basestring, regex: basestring) -> bool"""
 *         return f(value, regex)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11cfunc_dot_to_py_52__Pyx_CFunc_bint____basestring____basestring___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_bint____basestring, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_wrap = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "cfunc.to_py":68
 *         """wrap(value: basestring, regex: basestring) -> bool"""
 *         return f(value, regex)
 *     return wrap             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_wrap);
  __pyx_r = __pyx_v_wrap;
  goto __pyx_L0;

  /* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_bint____basestring____basestring___to_py")
 * cdef object __Pyx_CFunc_bint____basestring____basestring___to_py(bint (*f)(basestring, basestring) except *):             # <<<<<<<<<<<<<<
 *     def wrap(basestring value, basestring regex):
 *         """wrap(value: basestring, regex: basestring) -> bool"""
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_bint____basestring____basestring___to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_wrap);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_7sweepea__TableFunctionImpl __pyx_vtable_7sweepea__TableFunctionImpl;

static PyObject *__pyx_tp_new_7sweepea__TableFunctionImpl(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7sweepea__TableFunctionImpl *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_7sweepea__TableFunctionImpl *)o);
  p->__pyx_vtab = __pyx_vtabptr_7sweepea__TableFunctionImpl;
  p->table_function = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_7sweepea_18_TableFunctionImpl_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7sweepea__TableFunctionImpl(PyObject *o) {
  struct __pyx_obj_7sweepea__TableFunctionImpl *p = (struct __pyx_obj_7sweepea__TableFunctionImpl *)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);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7sweepea_18_TableFunctionImpl_3__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->table_function);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7sweepea__TableFunctionImpl(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea__TableFunctionImpl *p = (struct __pyx_obj_7sweepea__TableFunctionImpl *)o;
  if (p->table_function) {
    e = (*v)(p->table_function, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea__TableFunctionImpl(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea__TableFunctionImpl *p = (struct __pyx_obj_7sweepea__TableFunctionImpl *)o;
  tmp = ((PyObject*)p->table_function);
  p->table_function = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7sweepea__TableFunctionImpl[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7sweepea__TableFunctionImpl = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea._TableFunctionImpl", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea__TableFunctionImpl), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea__TableFunctionImpl, /*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_7sweepea__TableFunctionImpl, /*tp_traverse*/
  __pyx_tp_clear_7sweepea__TableFunctionImpl, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7sweepea__TableFunctionImpl, /*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_7sweepea__TableFunctionImpl, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7sweepea_CursorWrapper __pyx_vtable_7sweepea_CursorWrapper;

static PyObject *__pyx_tp_new_7sweepea_CursorWrapper(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7sweepea_CursorWrapper *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_7sweepea_CursorWrapper *)o);
  p->__pyx_vtab = __pyx_vtabptr_7sweepea_CursorWrapper;
  p->columns = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->result_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->cursor = Py_None; Py_INCREF(Py_None);
  p->transform = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7sweepea_CursorWrapper(PyObject *o) {
  struct __pyx_obj_7sweepea_CursorWrapper *p = (struct __pyx_obj_7sweepea_CursorWrapper *)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->columns);
  Py_CLEAR(p->result_cache);
  Py_CLEAR(p->cursor);
  Py_CLEAR(p->transform);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7sweepea_CursorWrapper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea_CursorWrapper *p = (struct __pyx_obj_7sweepea_CursorWrapper *)o;
  if (p->columns) {
    e = (*v)(p->columns, a); if (e) return e;
  }
  if (p->result_cache) {
    e = (*v)(p->result_cache, a); if (e) return e;
  }
  if (p->cursor) {
    e = (*v)(p->cursor, a); if (e) return e;
  }
  if (p->transform) {
    e = (*v)(p->transform, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea_CursorWrapper(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea_CursorWrapper *p = (struct __pyx_obj_7sweepea_CursorWrapper *)o;
  tmp = ((PyObject*)p->columns);
  p->columns = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->result_cache);
  p->result_cache = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->cursor);
  p->cursor = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->transform);
  p->transform = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7sweepea_CursorWrapper[] = {
  {"iterator", (PyCFunction)__pyx_pw_7sweepea_13CursorWrapper_7iterator, METH_NOARGS, 0},
  {"__next__", (PyCFunction)__pyx_pw_7sweepea_13CursorWrapper_10__next__, METH_NOARGS|METH_COEXIST, 0},
  {"fill_cache", (PyCFunction)__pyx_pw_7sweepea_13CursorWrapper_12fill_cache, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_CursorWrapper = {
  __pyx_pw_7sweepea_13CursorWrapper_5__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_CursorWrapper = {
  __pyx_pw_7sweepea_13CursorWrapper_5__len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7sweepea_CursorWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.CursorWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea_CursorWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea_CursorWrapper, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_CursorWrapper, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_CursorWrapper, /*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_7sweepea_CursorWrapper, /*tp_traverse*/
  __pyx_tp_clear_7sweepea_CursorWrapper, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_7sweepea_13CursorWrapper_3__iter__, /*tp_iter*/
  __pyx_pw_7sweepea_13CursorWrapper_10__next__, /*tp_iternext*/
  __pyx_methods_7sweepea_CursorWrapper, /*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*/
  __pyx_pw_7sweepea_13CursorWrapper_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7sweepea_CursorWrapper, /*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 PyObject *__pyx_tp_new_7sweepea_ResultIterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7sweepea_ResultIterator *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_7sweepea_ResultIterator *)o);
  p->cursor_wrapper = ((struct __pyx_obj_7sweepea_CursorWrapper *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7sweepea_ResultIterator(PyObject *o) {
  struct __pyx_obj_7sweepea_ResultIterator *p = (struct __pyx_obj_7sweepea_ResultIterator *)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->cursor_wrapper);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7sweepea_ResultIterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea_ResultIterator *p = (struct __pyx_obj_7sweepea_ResultIterator *)o;
  if (p->cursor_wrapper) {
    e = (*v)(((PyObject*)p->cursor_wrapper), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea_ResultIterator(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea_ResultIterator *p = (struct __pyx_obj_7sweepea_ResultIterator *)o;
  tmp = ((PyObject*)p->cursor_wrapper);
  p->cursor_wrapper = ((struct __pyx_obj_7sweepea_CursorWrapper *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7sweepea_ResultIterator[] = {
  {"__next__", (PyCFunction)__pyx_pw_7sweepea_14ResultIterator_3__next__, METH_NOARGS|METH_COEXIST, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7sweepea_ResultIterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.ResultIterator", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea_ResultIterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea_ResultIterator, /*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_7sweepea_ResultIterator, /*tp_traverse*/
  __pyx_tp_clear_7sweepea_ResultIterator, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  __pyx_pw_7sweepea_14ResultIterator_3__next__, /*tp_iternext*/
  __pyx_methods_7sweepea_ResultIterator, /*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*/
  __pyx_pw_7sweepea_14ResultIterator_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7sweepea_ResultIterator, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7sweepea_NamedTupleCursorWrapper __pyx_vtable_7sweepea_NamedTupleCursorWrapper;

static PyObject *__pyx_tp_new_7sweepea_NamedTupleCursorWrapper(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *p;
  PyObject *o = __pyx_tp_new_7sweepea_CursorWrapper(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_7sweepea_CursorWrapper*)__pyx_vtabptr_7sweepea_NamedTupleCursorWrapper;
  p->tuple_class = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7sweepea_NamedTupleCursorWrapper(PyObject *o) {
  struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *p = (struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *)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->tuple_class);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7sweepea_CursorWrapper(o);
}

static int __pyx_tp_traverse_7sweepea_NamedTupleCursorWrapper(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *p = (struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *)o;
  e = __pyx_tp_traverse_7sweepea_CursorWrapper(o, v, a); if (e) return e;
  if (p->tuple_class) {
    e = (*v)(p->tuple_class, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea_NamedTupleCursorWrapper(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *p = (struct __pyx_obj_7sweepea_NamedTupleCursorWrapper *)o;
  __pyx_tp_clear_7sweepea_CursorWrapper(o);
  tmp = ((PyObject*)p->tuple_class);
  p->tuple_class = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea_NamedTupleCursorWrapper = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.NamedTupleCursorWrapper", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea_NamedTupleCursorWrapper), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea_NamedTupleCursorWrapper, /*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_7sweepea_NamedTupleCursorWrapper, /*tp_traverse*/
  __pyx_tp_clear_7sweepea_NamedTupleCursorWrapper, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7sweepea_13CursorWrapper_3__iter__, /*tp_iter*/
  #else
  0, /*tp_iter*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7sweepea_13CursorWrapper_10__next__, /*tp_iternext*/
  #else
  0, /*tp_iternext*/
  #endif
  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*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7sweepea_13CursorWrapper_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_7sweepea_NamedTupleCursorWrapper, /*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 PyObject *__pyx_tp_new_7sweepea__callable_context_manager(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  return o;
}

static void __pyx_tp_dealloc_7sweepea__callable_context_manager(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7sweepea__callable_context_manager[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7sweepea__callable_context_manager = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea._callable_context_manager", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea__callable_context_manager), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea__callable_context_manager, /*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*/
  __pyx_pw_7sweepea_25_callable_context_manager_1__call__, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7sweepea__callable_context_manager, /*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_7sweepea__callable_context_manager, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7sweepea_Database __pyx_vtable_7sweepea_Database;

static PyObject *__pyx_tp_new_7sweepea_Database(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7sweepea_Database *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_7sweepea_Database *)o);
  p->__pyx_vtab = __pyx_vtabptr_7sweepea_Database;
  p->_aggregates = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_collations = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_functions = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_modules = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_function_map = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_table_functions = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_lock = Py_None; Py_INCREF(Py_None);
  p->_commit_hook = Py_None; Py_INCREF(Py_None);
  p->_rollback_hook = Py_None; Py_INCREF(Py_None);
  p->_update_hook = Py_None; Py_INCREF(Py_None);
  p->connect_kwargs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_pragmas = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->database = Py_None; Py_INCREF(Py_None);
  p->_local = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7sweepea_Database(PyObject *o) {
  struct __pyx_obj_7sweepea_Database *p = (struct __pyx_obj_7sweepea_Database *)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);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_7sweepea_8Database_5__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->_aggregates);
  Py_CLEAR(p->_collations);
  Py_CLEAR(p->_functions);
  Py_CLEAR(p->_modules);
  Py_CLEAR(p->_function_map);
  Py_CLEAR(p->_table_functions);
  Py_CLEAR(p->_lock);
  Py_CLEAR(p->_commit_hook);
  Py_CLEAR(p->_rollback_hook);
  Py_CLEAR(p->_update_hook);
  Py_CLEAR(p->connect_kwargs);
  Py_CLEAR(p->_pragmas);
  Py_CLEAR(p->database);
  Py_CLEAR(p->_local);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7sweepea_Database(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea_Database *p = (struct __pyx_obj_7sweepea_Database *)o;
  if (p->_aggregates) {
    e = (*v)(p->_aggregates, a); if (e) return e;
  }
  if (p->_collations) {
    e = (*v)(p->_collations, a); if (e) return e;
  }
  if (p->_functions) {
    e = (*v)(p->_functions, a); if (e) return e;
  }
  if (p->_modules) {
    e = (*v)(p->_modules, a); if (e) return e;
  }
  if (p->_function_map) {
    e = (*v)(p->_function_map, a); if (e) return e;
  }
  if (p->_table_functions) {
    e = (*v)(p->_table_functions, a); if (e) return e;
  }
  if (p->_lock) {
    e = (*v)(p->_lock, a); if (e) return e;
  }
  if (p->_commit_hook) {
    e = (*v)(p->_commit_hook, a); if (e) return e;
  }
  if (p->_rollback_hook) {
    e = (*v)(p->_rollback_hook, a); if (e) return e;
  }
  if (p->_update_hook) {
    e = (*v)(p->_update_hook, a); if (e) return e;
  }
  if (p->connect_kwargs) {
    e = (*v)(p->connect_kwargs, a); if (e) return e;
  }
  if (p->_pragmas) {
    e = (*v)(p->_pragmas, a); if (e) return e;
  }
  if (p->database) {
    e = (*v)(p->database, a); if (e) return e;
  }
  if (p->_local) {
    e = (*v)(p->_local, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea_Database(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea_Database *p = (struct __pyx_obj_7sweepea_Database *)o;
  tmp = ((PyObject*)p->_aggregates);
  p->_aggregates = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_collations);
  p->_collations = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_functions);
  p->_functions = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_modules);
  p->_modules = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_function_map);
  p->_function_map = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_table_functions);
  p->_table_functions = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_lock);
  p->_lock = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_commit_hook);
  p->_commit_hook = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_rollback_hook);
  p->_rollback_hook = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_update_hook);
  p->_update_hook = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->connect_kwargs);
  p->connect_kwargs = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_pragmas);
  p->_pragmas = ((PyObject*)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->_local);
  p->_local = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_7sweepea_Database(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_getprop_7sweepea_8Database_last_insert_id(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_8Database_14last_insert_id_1__get__(o);
}

static PyObject *__pyx_getprop_7sweepea_8Database_autocommit(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_8Database_10autocommit_1__get__(o);
}

static PyObject *__pyx_getprop_7sweepea_8Database_rowcount(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_8Database_8rowcount_1__get__(o);
}

static PyObject *__pyx_getprop_7sweepea_8Database_connect_kwargs(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_8Database_14connect_kwargs_1__get__(o);
}

static int __pyx_setprop_7sweepea_8Database_connect_kwargs(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7sweepea_8Database_14connect_kwargs_3__set__(o, v);
  }
  else {
    return __pyx_pw_7sweepea_8Database_14connect_kwargs_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7sweepea_8Database__pragmas(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_8Database_8_pragmas_1__get__(o);
}

static int __pyx_setprop_7sweepea_8Database__pragmas(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7sweepea_8Database_8_pragmas_3__set__(o, v);
  }
  else {
    return __pyx_pw_7sweepea_8Database_8_pragmas_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7sweepea_8Database_database(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_8Database_8database_1__get__(o);
}

static int __pyx_setprop_7sweepea_8Database_database(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7sweepea_8Database_8database_3__set__(o, v);
  }
  else {
    return __pyx_pw_7sweepea_8Database_8database_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7sweepea_8Database_deferred(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_8Database_8deferred_1__get__(o);
}

static PyObject *__pyx_getprop_7sweepea_8Database__local(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_8Database_6_local_1__get__(o);
}

static PyMethodDef __pyx_methods_7sweepea_Database[] = {
  {"init", (PyCFunction)__pyx_pw_7sweepea_8Database_3init, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7sweepea_8Database_2init},
  {"connect", (PyCFunction)__pyx_pw_7sweepea_8Database_7connect, METH_NOARGS, __pyx_doc_7sweepea_8Database_6connect},
  {"close", (PyCFunction)__pyx_pw_7sweepea_8Database_9close, METH_NOARGS, __pyx_doc_7sweepea_8Database_8close},
  {"initialize_connection", (PyCFunction)__pyx_pw_7sweepea_8Database_11initialize_connection, METH_O, __pyx_doc_7sweepea_8Database_10initialize_connection},
  {"_create_aggregate", (PyCFunction)__pyx_pw_7sweepea_8Database_13_create_aggregate, METH_VARARGS|METH_KEYWORDS, 0},
  {"aggregate", (PyCFunction)__pyx_pw_7sweepea_8Database_15aggregate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7sweepea_8Database_14aggregate},
  {"collation", (PyCFunction)__pyx_pw_7sweepea_8Database_17collation, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7sweepea_8Database_16collation},
  {"func", (PyCFunction)__pyx_pw_7sweepea_8Database_19func, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7sweepea_8Database_18func},
  {"table_function", (PyCFunction)__pyx_pw_7sweepea_8Database_21table_function, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7sweepea_8Database_20table_function},
  {"on_commit", (PyCFunction)__pyx_pw_7sweepea_8Database_23on_commit, METH_O, __pyx_doc_7sweepea_8Database_22on_commit},
  {"_set_commit_hook", (PyCFunction)__pyx_pw_7sweepea_8Database_25_set_commit_hook, METH_VARARGS|METH_KEYWORDS, 0},
  {"on_rollback", (PyCFunction)__pyx_pw_7sweepea_8Database_27on_rollback, METH_O, __pyx_doc_7sweepea_8Database_26on_rollback},
  {"_set_rollback_hook", (PyCFunction)__pyx_pw_7sweepea_8Database_29_set_rollback_hook, METH_VARARGS|METH_KEYWORDS, 0},
  {"on_update", (PyCFunction)__pyx_pw_7sweepea_8Database_31on_update, METH_O, __pyx_doc_7sweepea_8Database_30on_update},
  {"_set_update_hook", (PyCFunction)__pyx_pw_7sweepea_8Database_33_set_update_hook, METH_VARARGS|METH_KEYWORDS, 0},
  {"is_closed", (PyCFunction)__pyx_pw_7sweepea_8Database_35is_closed, METH_NOARGS, __pyx_doc_7sweepea_8Database_34is_closed},
  {"execute_sql", (PyCFunction)__pyx_pw_7sweepea_8Database_37execute_sql, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7sweepea_8Database_36execute_sql},
  {"execute", (PyCFunction)__pyx_pw_7sweepea_8Database_39execute, METH_O, __pyx_doc_7sweepea_8Database_38execute},
  {"sql", (PyCFunction)__pyx_pw_7sweepea_8Database_41sql, METH_O, __pyx_doc_7sweepea_8Database_40sql},
  {"pragma", (PyCFunction)__pyx_pw_7sweepea_8Database_43pragma, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7sweepea_8Database_42pragma},
  {"begin", (PyCFunction)__pyx_pw_7sweepea_8Database_45begin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7sweepea_8Database_44begin},
  {"commit", (PyCFunction)__pyx_pw_7sweepea_8Database_47commit, METH_NOARGS, __pyx_doc_7sweepea_8Database_46commit},
  {"rollback", (PyCFunction)__pyx_pw_7sweepea_8Database_49rollback, METH_NOARGS, __pyx_doc_7sweepea_8Database_48rollback},
  {"__enter__", (PyCFunction)__pyx_pw_7sweepea_8Database_53__enter__, METH_NOARGS, 0},
  {"__exit__", (PyCFunction)__pyx_pw_7sweepea_8Database_55__exit__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7sweepea_8Database_54__exit__},
  {"set_busy_handler", (PyCFunction)__pyx_pw_7sweepea_8Database_57set_busy_handler, METH_VARARGS|METH_KEYWORDS, __pyx_doc_7sweepea_8Database_56set_busy_handler},
  {"atomic", (PyCFunction)__pyx_pw_7sweepea_8Database_59atomic, METH_NOARGS, __pyx_doc_7sweepea_8Database_58atomic},
  {"transaction", (PyCFunction)__pyx_pw_7sweepea_8Database_61transaction, METH_NOARGS, __pyx_doc_7sweepea_8Database_60transaction},
  {"savepoint", (PyCFunction)__pyx_pw_7sweepea_8Database_63savepoint, METH_NOARGS, __pyx_doc_7sweepea_8Database_62savepoint},
  {"get_tables", (PyCFunction)__pyx_pw_7sweepea_8Database_65get_tables, METH_NOARGS, __pyx_doc_7sweepea_8Database_64get_tables},
  {"get_indexes", (PyCFunction)__pyx_pw_7sweepea_8Database_67get_indexes, METH_O, __pyx_doc_7sweepea_8Database_66get_indexes},
  {"get_columns", (PyCFunction)__pyx_pw_7sweepea_8Database_69get_columns, METH_O, __pyx_doc_7sweepea_8Database_68get_columns},
  {"get_primary_keys", (PyCFunction)__pyx_pw_7sweepea_8Database_71get_primary_keys, METH_O, __pyx_doc_7sweepea_8Database_70get_primary_keys},
  {"get_foreign_keys", (PyCFunction)__pyx_pw_7sweepea_8Database_73get_foreign_keys, METH_O, __pyx_doc_7sweepea_8Database_72get_foreign_keys},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7sweepea_Database[] = {
  {(char *)"last_insert_id", __pyx_getprop_7sweepea_8Database_last_insert_id, 0, (char *)"Return the rowid of the most-recently-inserted row.", 0},
  {(char *)"autocommit", __pyx_getprop_7sweepea_8Database_autocommit, 0, (char *)"Return a boolean value indicating the status of autocommit.", 0},
  {(char *)"rowcount", __pyx_getprop_7sweepea_8Database_rowcount, 0, (char *)"\n        Return the number of rows changed by the most-recently executed query.\n        ", 0},
  {(char *)"connect_kwargs", __pyx_getprop_7sweepea_8Database_connect_kwargs, __pyx_setprop_7sweepea_8Database_connect_kwargs, (char *)0, 0},
  {(char *)"_pragmas", __pyx_getprop_7sweepea_8Database__pragmas, __pyx_setprop_7sweepea_8Database__pragmas, (char *)0, 0},
  {(char *)"database", __pyx_getprop_7sweepea_8Database_database, __pyx_setprop_7sweepea_8Database_database, (char *)0, 0},
  {(char *)"deferred", __pyx_getprop_7sweepea_8Database_deferred, 0, (char *)0, 0},
  {(char *)"_local", __pyx_getprop_7sweepea_8Database__local, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence_Database = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_7sweepea_Database, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Database = {
  0, /*mp_length*/
  __pyx_pw_7sweepea_8Database_51__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_7sweepea_Database = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.Database", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea_Database), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea_Database, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Database, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Database, /*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*/
  "\n    The :py:class:`Database` provides an additional layer of abstraction over\n    the underlying database connection. The `Database` allows configuration\n    state to be maintained across connections (or threads) by:\n\n    * Automatically registering functions, collations, aggregates, modules,\n      and table-functions across re-connects/threads.\n    * Managing commit-, rollback- and update-hook registration.\n    * Setting PRAGMAs during connection initialization.\n\n    The `Database` is also used to execute queries using the current thread's\n    connection, and to track the state of nested atomic blocks.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7sweepea_Database, /*tp_traverse*/
  __pyx_tp_clear_7sweepea_Database, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7sweepea_Database, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7sweepea_Database, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7sweepea_8Database_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7sweepea_Database, /*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 PyObject *__pyx_tp_new_7sweepea__atomic(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7sweepea__atomic *p;
  PyObject *o = __pyx_tp_new_7sweepea__callable_context_manager(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7sweepea__atomic *)o);
  p->db = ((struct __pyx_obj_7sweepea_Database *)Py_None); Py_INCREF(Py_None);
  p->_helper = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7sweepea__atomic(PyObject *o) {
  struct __pyx_obj_7sweepea__atomic *p = (struct __pyx_obj_7sweepea__atomic *)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->db);
  Py_CLEAR(p->_helper);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7sweepea__callable_context_manager(o);
}

static int __pyx_tp_traverse_7sweepea__atomic(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea__atomic *p = (struct __pyx_obj_7sweepea__atomic *)o;
  e = ((likely(__pyx_ptype_7sweepea__callable_context_manager)) ? ((__pyx_ptype_7sweepea__callable_context_manager->tp_traverse) ? __pyx_ptype_7sweepea__callable_context_manager->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7sweepea__atomic)); if (e) return e;
  if (p->db) {
    e = (*v)(((PyObject*)p->db), a); if (e) return e;
  }
  if (p->_helper) {
    e = (*v)(p->_helper, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea__atomic(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea__atomic *p = (struct __pyx_obj_7sweepea__atomic *)o;
  if (likely(__pyx_ptype_7sweepea__callable_context_manager)) { if (__pyx_ptype_7sweepea__callable_context_manager->tp_clear) __pyx_ptype_7sweepea__callable_context_manager->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7sweepea__atomic);
  tmp = ((PyObject*)p->db);
  p->db = ((struct __pyx_obj_7sweepea_Database *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_helper);
  p->_helper = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7sweepea__atomic[] = {
  {"__enter__", (PyCFunction)__pyx_pw_7sweepea_7_atomic_3__enter__, METH_NOARGS, 0},
  {"__exit__", (PyCFunction)__pyx_pw_7sweepea_7_atomic_5__exit__, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7sweepea__atomic = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea._atomic", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea__atomic), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea__atomic, /*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*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7sweepea_25_callable_context_manager_1__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  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_7sweepea__atomic, /*tp_traverse*/
  __pyx_tp_clear_7sweepea__atomic, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7sweepea__atomic, /*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*/
  __pyx_pw_7sweepea_7_atomic_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7sweepea__atomic, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7sweepea__transaction __pyx_vtable_7sweepea__transaction;

static PyObject *__pyx_tp_new_7sweepea__transaction(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7sweepea__transaction *p;
  PyObject *o = __pyx_tp_new_7sweepea__callable_context_manager(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7sweepea__transaction *)o);
  p->__pyx_vtab = __pyx_vtabptr_7sweepea__transaction;
  p->lock = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->db = ((struct __pyx_obj_7sweepea_Database *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7sweepea__transaction(PyObject *o) {
  struct __pyx_obj_7sweepea__transaction *p = (struct __pyx_obj_7sweepea__transaction *)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->lock);
  Py_CLEAR(p->db);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7sweepea__callable_context_manager(o);
}

static int __pyx_tp_traverse_7sweepea__transaction(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea__transaction *p = (struct __pyx_obj_7sweepea__transaction *)o;
  e = ((likely(__pyx_ptype_7sweepea__callable_context_manager)) ? ((__pyx_ptype_7sweepea__callable_context_manager->tp_traverse) ? __pyx_ptype_7sweepea__callable_context_manager->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7sweepea__transaction)); if (e) return e;
  if (p->db) {
    e = (*v)(((PyObject*)p->db), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea__transaction(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea__transaction *p = (struct __pyx_obj_7sweepea__transaction *)o;
  if (likely(__pyx_ptype_7sweepea__callable_context_manager)) { if (__pyx_ptype_7sweepea__callable_context_manager->tp_clear) __pyx_ptype_7sweepea__callable_context_manager->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7sweepea__transaction);
  tmp = ((PyObject*)p->db);
  p->db = ((struct __pyx_obj_7sweepea_Database *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7sweepea__transaction[] = {
  {"_begin", (PyCFunction)__pyx_pw_7sweepea_12_transaction_3_begin, METH_NOARGS, 0},
  {"commit", (PyCFunction)__pyx_pw_7sweepea_12_transaction_5commit, METH_VARARGS|METH_KEYWORDS, 0},
  {"rollback", (PyCFunction)__pyx_pw_7sweepea_12_transaction_7rollback, METH_VARARGS|METH_KEYWORDS, 0},
  {"__enter__", (PyCFunction)__pyx_pw_7sweepea_12_transaction_9__enter__, METH_NOARGS, 0},
  {"__exit__", (PyCFunction)__pyx_pw_7sweepea_12_transaction_11__exit__, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7sweepea__transaction = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea._transaction", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea__transaction), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea__transaction, /*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*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7sweepea_25_callable_context_manager_1__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  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_7sweepea__transaction, /*tp_traverse*/
  __pyx_tp_clear_7sweepea__transaction, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7sweepea__transaction, /*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*/
  __pyx_pw_7sweepea_12_transaction_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7sweepea__transaction, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7sweepea__savepoint __pyx_vtable_7sweepea__savepoint;

static PyObject *__pyx_tp_new_7sweepea__savepoint(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_7sweepea__savepoint *p;
  PyObject *o = __pyx_tp_new_7sweepea__callable_context_manager(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_7sweepea__savepoint *)o);
  p->__pyx_vtab = __pyx_vtabptr_7sweepea__savepoint;
  p->sid = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->quoted_sid = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->db = ((struct __pyx_obj_7sweepea_Database *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7sweepea__savepoint(PyObject *o) {
  struct __pyx_obj_7sweepea__savepoint *p = (struct __pyx_obj_7sweepea__savepoint *)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->sid);
  Py_CLEAR(p->quoted_sid);
  Py_CLEAR(p->db);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_7sweepea__callable_context_manager(o);
}

static int __pyx_tp_traverse_7sweepea__savepoint(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea__savepoint *p = (struct __pyx_obj_7sweepea__savepoint *)o;
  e = ((likely(__pyx_ptype_7sweepea__callable_context_manager)) ? ((__pyx_ptype_7sweepea__callable_context_manager->tp_traverse) ? __pyx_ptype_7sweepea__callable_context_manager->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_7sweepea__savepoint)); if (e) return e;
  if (p->db) {
    e = (*v)(((PyObject*)p->db), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea__savepoint(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea__savepoint *p = (struct __pyx_obj_7sweepea__savepoint *)o;
  if (likely(__pyx_ptype_7sweepea__callable_context_manager)) { if (__pyx_ptype_7sweepea__callable_context_manager->tp_clear) __pyx_ptype_7sweepea__callable_context_manager->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_7sweepea__savepoint);
  tmp = ((PyObject*)p->db);
  p->db = ((struct __pyx_obj_7sweepea_Database *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_7sweepea__savepoint[] = {
  {"_execute", (PyCFunction)__pyx_pw_7sweepea_10_savepoint_3_execute, METH_O, 0},
  {"commit", (PyCFunction)__pyx_pw_7sweepea_10_savepoint_5commit, METH_NOARGS, 0},
  {"rollback", (PyCFunction)__pyx_pw_7sweepea_10_savepoint_7rollback, METH_NOARGS, 0},
  {"__enter__", (PyCFunction)__pyx_pw_7sweepea_10_savepoint_9__enter__, METH_NOARGS, 0},
  {"__exit__", (PyCFunction)__pyx_pw_7sweepea_10_savepoint_11__exit__, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7sweepea__savepoint = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea._savepoint", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea__savepoint), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea__savepoint, /*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*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_7sweepea_25_callable_context_manager_1__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  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_7sweepea__savepoint, /*tp_traverse*/
  __pyx_tp_clear_7sweepea__savepoint, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7sweepea__savepoint, /*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*/
  __pyx_pw_7sweepea_10_savepoint_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7sweepea__savepoint, /*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 PyObject *__pyx_tp_new_7sweepea_State(PyTypeObject *t, PyObject *a, PyObject *k) {
  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;
  if (unlikely(__pyx_pw_7sweepea_5State_1__cinit__(o, a, k) < 0)) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7sweepea_State(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_7sweepea_State[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7sweepea_State = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.State", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea_State), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea_State, /*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*/
  __pyx_pw_7sweepea_5State_3__call__, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Lightweight object for representing the rules applied at a given scope.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7sweepea_State, /*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_7sweepea_State, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_7sweepea_Context __pyx_vtable_7sweepea_Context;

static PyObject *__pyx_tp_new_7sweepea_Context(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7sweepea_Context *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_7sweepea_Context *)o);
  p->__pyx_vtab = __pyx_vtabptr_7sweepea_Context;
  p->parentheses = Py_None; Py_INCREF(Py_None);
  p->subquery = Py_None; Py_INCREF(Py_None);
  p->stack = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_sql = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_values = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->state = ((struct __pyx_obj_7sweepea_State *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7sweepea_Context(PyObject *o) {
  struct __pyx_obj_7sweepea_Context *p = (struct __pyx_obj_7sweepea_Context *)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->parentheses);
  Py_CLEAR(p->subquery);
  Py_CLEAR(p->stack);
  Py_CLEAR(p->_sql);
  Py_CLEAR(p->_values);
  Py_CLEAR(p->state);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7sweepea_Context(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea_Context *p = (struct __pyx_obj_7sweepea_Context *)o;
  if (p->parentheses) {
    e = (*v)(p->parentheses, a); if (e) return e;
  }
  if (p->subquery) {
    e = (*v)(p->subquery, a); if (e) return e;
  }
  if (p->stack) {
    e = (*v)(p->stack, a); if (e) return e;
  }
  if (p->_sql) {
    e = (*v)(p->_sql, a); if (e) return e;
  }
  if (p->_values) {
    e = (*v)(p->_values, a); if (e) return e;
  }
  if (p->state) {
    e = (*v)(((PyObject*)p->state), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea_Context(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea_Context *p = (struct __pyx_obj_7sweepea_Context *)o;
  tmp = ((PyObject*)p->parentheses);
  p->parentheses = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->subquery);
  p->subquery = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->stack);
  p->stack = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_sql);
  p->_sql = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_values);
  p->_values = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->state);
  p->state = ((struct __pyx_obj_7sweepea_State *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_7sweepea_7Context_parentheses(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_7Context_11parentheses_1__get__(o);
}

static int __pyx_setprop_7sweepea_7Context_parentheses(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7sweepea_7Context_11parentheses_3__set__(o, v);
  }
  else {
    return __pyx_pw_7sweepea_7Context_11parentheses_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7sweepea_7Context_subquery(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_7Context_8subquery_1__get__(o);
}

static int __pyx_setprop_7sweepea_7Context_subquery(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7sweepea_7Context_8subquery_3__set__(o, v);
  }
  else {
    return __pyx_pw_7sweepea_7Context_8subquery_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7sweepea_7Context_scope(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_7Context_5scope_1__get__(o);
}

static int __pyx_setprop_7sweepea_7Context_scope(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7sweepea_7Context_5scope_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_7sweepea_7Context_stack(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_7Context_5stack_1__get__(o);
}

static int __pyx_setprop_7sweepea_7Context_stack(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7sweepea_7Context_5stack_3__set__(o, v);
  }
  else {
    return __pyx_pw_7sweepea_7Context_5stack_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7sweepea_7Context__sql(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_7Context_4_sql_1__get__(o);
}

static int __pyx_setprop_7sweepea_7Context__sql(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7sweepea_7Context_4_sql_3__set__(o, v);
  }
  else {
    return __pyx_pw_7sweepea_7Context_4_sql_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7sweepea_7Context__values(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_7Context_7_values_1__get__(o);
}

static int __pyx_setprop_7sweepea_7Context__values(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7sweepea_7Context_7_values_3__set__(o, v);
  }
  else {
    return __pyx_pw_7sweepea_7Context_7_values_5__del__(o);
  }
}

static PyObject *__pyx_getprop_7sweepea_7Context_state(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_7sweepea_7Context_5state_1__get__(o);
}

static int __pyx_setprop_7sweepea_7Context_state(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_7sweepea_7Context_5state_3__set__(o, v);
  }
  else {
    return __pyx_pw_7sweepea_7Context_5state_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_7sweepea_Context[] = {
  {"__enter__", (PyCFunction)__pyx_pw_7sweepea_7Context_5__enter__, METH_NOARGS, 0},
  {"__exit__", (PyCFunction)__pyx_pw_7sweepea_7Context_7__exit__, METH_VARARGS|METH_KEYWORDS, 0},
  {"sql", (PyCFunction)__pyx_pw_7sweepea_7Context_9sql, METH_O, 0},
  {"literal", (PyCFunction)__pyx_pw_7sweepea_7Context_11literal, METH_O, 0},
  {"parse", (PyCFunction)__pyx_pw_7sweepea_7Context_13parse, METH_O, 0},
  {"query", (PyCFunction)__pyx_pw_7sweepea_7Context_15query, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_7sweepea_Context[] = {
  {(char *)"parentheses", __pyx_getprop_7sweepea_7Context_parentheses, __pyx_setprop_7sweepea_7Context_parentheses, (char *)0, 0},
  {(char *)"subquery", __pyx_getprop_7sweepea_7Context_subquery, __pyx_setprop_7sweepea_7Context_subquery, (char *)0, 0},
  {(char *)"scope", __pyx_getprop_7sweepea_7Context_scope, __pyx_setprop_7sweepea_7Context_scope, (char *)0, 0},
  {(char *)"stack", __pyx_getprop_7sweepea_7Context_stack, __pyx_setprop_7sweepea_7Context_stack, (char *)0, 0},
  {(char *)"_sql", __pyx_getprop_7sweepea_7Context__sql, __pyx_setprop_7sweepea_7Context__sql, (char *)0, 0},
  {(char *)"_values", __pyx_getprop_7sweepea_7Context__values, __pyx_setprop_7sweepea_7Context__values, (char *)0, 0},
  {(char *)"state", __pyx_getprop_7sweepea_7Context_state, __pyx_setprop_7sweepea_7Context_state, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7sweepea_Context = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.Context", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea_Context), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea_Context, /*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*/
  __pyx_pw_7sweepea_7Context_3__call__, /*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*/
  "\n    The Context converts SQL fragments into queries and bind-values. Maintains\n    state during the SQL generation to ensure different entities render\n    correctly.\n    ", /*tp_doc*/
  __pyx_tp_traverse_7sweepea_Context, /*tp_traverse*/
  __pyx_tp_clear_7sweepea_Context, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7sweepea_Context, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_7sweepea_Context, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_7sweepea_7Context_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7sweepea_Context, /*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 PyObject *__pyx_tp_new_7sweepea_ColumnFactory(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_7sweepea_ColumnFactory *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_7sweepea_ColumnFactory *)o);
  p->source = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_7sweepea_ColumnFactory(PyObject *o) {
  struct __pyx_obj_7sweepea_ColumnFactory *p = (struct __pyx_obj_7sweepea_ColumnFactory *)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->source);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_7sweepea_ColumnFactory(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea_ColumnFactory *p = (struct __pyx_obj_7sweepea_ColumnFactory *)o;
  if (p->source) {
    e = (*v)(p->source, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea_ColumnFactory(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea_ColumnFactory *p = (struct __pyx_obj_7sweepea_ColumnFactory *)o;
  tmp = ((PyObject*)p->source);
  p->source = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_tp_getattro_7sweepea_ColumnFactory(PyObject *o, PyObject *n) {
  PyObject *v = PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_pw_7sweepea_13ColumnFactory_3__getattr__(o, n);
  }
  return v;
}

static PyMethodDef __pyx_methods_7sweepea_ColumnFactory[] = {
  {"__getattr__", (PyCFunction)__pyx_pw_7sweepea_13ColumnFactory_3__getattr__, METH_O|METH_COEXIST, 0},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7sweepea_ColumnFactory = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.ColumnFactory", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea_ColumnFactory), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea_ColumnFactory, /*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*/
  __pyx_tp_getattro_7sweepea_ColumnFactory, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    Lightweight factory for creating Column objects dynamically by overriding\n    the getattr hook.\n\n    For example::\n\n        User = Table('users')\n        username = User.c.username\n        # The above is equivalent to:\n        username = Column(User, 'username')\n    ", /*tp_doc*/
  __pyx_tp_traverse_7sweepea_ColumnFactory, /*tp_traverse*/
  __pyx_tp_clear_7sweepea_ColumnFactory, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7sweepea_ColumnFactory, /*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*/
  __pyx_pw_7sweepea_13ColumnFactory_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7sweepea_ColumnFactory, /*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 PyObject *__pyx_tp_new_7sweepea__DynamicColumn(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  return o;
}

static void __pyx_tp_dealloc_7sweepea__DynamicColumn(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_tp_descr_get_7sweepea__DynamicColumn(PyObject *o, PyObject *i, PyObject *c) {
  PyObject *r = 0;
  if (!i) i = Py_None;
  if (!c) c = Py_None;
  r = __pyx_pw_7sweepea_14_DynamicColumn_1__get__(o, i, c);
  return r;
}

static PyMethodDef __pyx_methods_7sweepea__DynamicColumn[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7sweepea__DynamicColumn = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea._DynamicColumn", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea__DynamicColumn), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea__DynamicColumn, /*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, /*tp_flags*/
  "\n    Descriptor that exposes the ColumnFactory as a \"magic\" attribute.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7sweepea__DynamicColumn, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  __pyx_tp_descr_get_7sweepea__DynamicColumn, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7sweepea__DynamicColumn, /*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 PyObject *__pyx_tp_new_7sweepea__ExplicitColumn(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  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;
  return o;
}

static void __pyx_tp_dealloc_7sweepea__ExplicitColumn(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_tp_descr_get_7sweepea__ExplicitColumn(PyObject *o, PyObject *i, PyObject *c) {
  PyObject *r = 0;
  if (!i) i = Py_None;
  if (!c) c = Py_None;
  r = __pyx_pw_7sweepea_15_ExplicitColumn_1__get__(o, i, c);
  return r;
}

static PyMethodDef __pyx_methods_7sweepea__ExplicitColumn[] = {
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_7sweepea__ExplicitColumn = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea._ExplicitColumn", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea__ExplicitColumn), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea__ExplicitColumn, /*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, /*tp_flags*/
  "\n    Descriptor that prevents \"magic\" attribute lookup for sources that define\n    their own column attributes.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_7sweepea__ExplicitColumn, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  __pyx_tp_descr_get_7sweepea__ExplicitColumn, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7sweepea__ExplicitColumn, /*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_7sweepea___pyx_scope_struct__make_hash *__pyx_freelist_7sweepea___pyx_scope_struct__make_hash[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct__make_hash = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct__make_hash(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct__make_hash > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct__make_hash[--__pyx_freecount_7sweepea___pyx_scope_struct__make_hash];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash));
    (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_7sweepea___pyx_scope_struct__make_hash(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash *p = (struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_hash_impl);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct__make_hash < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct__make_hash[__pyx_freecount_7sweepea___pyx_scope_struct__make_hash++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct__make_hash(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash *p = (struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash *)o;
  if (p->__pyx_v_hash_impl) {
    e = (*v)(p->__pyx_v_hash_impl, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct__make_hash(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash *p = (struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash *)o;
  tmp = ((PyObject*)p->__pyx_v_hash_impl);
  p->__pyx_v_hash_impl = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct__make_hash = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct__make_hash", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct__make_hash), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct__make_hash, /*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_7sweepea___pyx_scope_struct__make_hash, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct__make_hash, /*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_7sweepea___pyx_scope_struct__make_hash, /*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_7sweepea___pyx_scope_struct_1_iterator *__pyx_freelist_7sweepea___pyx_scope_struct_1_iterator[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_1_iterator = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_1_iterator(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_1_iterator > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_1_iterator[--__pyx_freecount_7sweepea___pyx_scope_struct_1_iterator];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator));
    (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_7sweepea___pyx_scope_struct_1_iterator(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_1_iterator < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_1_iterator[__pyx_freecount_7sweepea___pyx_scope_struct_1_iterator++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_1_iterator(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_1_iterator(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7sweepea_CursorWrapper *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_1_iterator = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_1_iterator", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_1_iterator), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_1_iterator, /*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_7sweepea___pyx_scope_struct_1_iterator, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_1_iterator, /*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_7sweepea___pyx_scope_struct_1_iterator, /*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_7sweepea___pyx_scope_struct_2___call__ *__pyx_freelist_7sweepea___pyx_scope_struct_2___call__[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_2___call__ = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_2___call__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_2___call__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_2___call__[--__pyx_freecount_7sweepea___pyx_scope_struct_2___call__];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__));
    (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_7sweepea___pyx_scope_struct_2___call__(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_fn);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_2___call__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_2___call__[__pyx_freecount_7sweepea___pyx_scope_struct_2___call__++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_2___call__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__ *)o;
  if (p->__pyx_v_fn) {
    e = (*v)(p->__pyx_v_fn, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_2___call__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__ *)o;
  tmp = ((PyObject*)p->__pyx_v_fn);
  p->__pyx_v_fn = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7sweepea__callable_context_manager *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_2___call__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_2___call__", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_2___call__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_2___call__, /*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_7sweepea___pyx_scope_struct_2___call__, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_2___call__, /*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_7sweepea___pyx_scope_struct_2___call__, /*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_7sweepea___pyx_scope_struct_3___status__ *__pyx_freelist_7sweepea___pyx_scope_struct_3___status__[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_3___status__ = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_3___status__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_3___status__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_3___status__[--__pyx_freecount_7sweepea___pyx_scope_struct_3___status__];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__));
    (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_7sweepea___pyx_scope_struct_3___status__(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_flag);
  Py_CLEAR(p->__pyx_v_return_highwater);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_3___status__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_3___status__[__pyx_freecount_7sweepea___pyx_scope_struct_3___status__++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_3___status__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__ *)o;
  if (p->__pyx_v_flag) {
    e = (*v)(p->__pyx_v_flag, a); if (e) return e;
  }
  if (p->__pyx_v_return_highwater) {
    e = (*v)(p->__pyx_v_return_highwater, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_3___status__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__ *)o;
  tmp = ((PyObject*)p->__pyx_v_flag);
  p->__pyx_v_flag = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_return_highwater);
  p->__pyx_v_return_highwater = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_3___status__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_3___status__", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_3___status__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_3___status__, /*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_7sweepea___pyx_scope_struct_3___status__, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_3___status__, /*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_7sweepea___pyx_scope_struct_3___status__, /*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_7sweepea___pyx_scope_struct_4___dbstatus__ *__pyx_freelist_7sweepea___pyx_scope_struct_4___dbstatus__[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_4___dbstatus__ = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_4___dbstatus__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_4___dbstatus__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_4___dbstatus__[--__pyx_freecount_7sweepea___pyx_scope_struct_4___dbstatus__];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__));
    (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_7sweepea___pyx_scope_struct_4___dbstatus__(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_flag);
  Py_CLEAR(p->__pyx_v_return_current);
  Py_CLEAR(p->__pyx_v_return_highwater);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_4___dbstatus__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_4___dbstatus__[__pyx_freecount_7sweepea___pyx_scope_struct_4___dbstatus__++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_4___dbstatus__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__ *)o;
  if (p->__pyx_v_flag) {
    e = (*v)(p->__pyx_v_flag, a); if (e) return e;
  }
  if (p->__pyx_v_return_current) {
    e = (*v)(p->__pyx_v_return_current, a); if (e) return e;
  }
  if (p->__pyx_v_return_highwater) {
    e = (*v)(p->__pyx_v_return_highwater, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_4___dbstatus__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__ *)o;
  tmp = ((PyObject*)p->__pyx_v_flag);
  p->__pyx_v_flag = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_return_current);
  p->__pyx_v_return_current = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_return_highwater);
  p->__pyx_v_return_highwater = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_4___dbstatus__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_4___dbstatus__", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_4___dbstatus__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_4___dbstatus__, /*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_7sweepea___pyx_scope_struct_4___dbstatus__, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_4___dbstatus__, /*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_7sweepea___pyx_scope_struct_4___dbstatus__, /*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_7sweepea___pyx_scope_struct_5___pragma__ *__pyx_freelist_7sweepea___pyx_scope_struct_5___pragma__[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_5___pragma__ = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_5___pragma__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_5___pragma__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_5___pragma__[--__pyx_freecount_7sweepea___pyx_scope_struct_5___pragma__];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__));
    (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_7sweepea___pyx_scope_struct_5___pragma__(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_name);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_5___pragma__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_5___pragma__[__pyx_freecount_7sweepea___pyx_scope_struct_5___pragma__++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_5___pragma__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *)o;
  if (p->__pyx_v_name) {
    e = (*v)(p->__pyx_v_name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_5___pragma__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__ *)o;
  tmp = ((PyObject*)p->__pyx_v_name);
  p->__pyx_v_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_5___pragma__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_5___pragma__", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_5___pragma__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_5___pragma__, /*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_7sweepea___pyx_scope_struct_5___pragma__, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_5___pragma__, /*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_7sweepea___pyx_scope_struct_5___pragma__, /*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_7sweepea___pyx_scope_struct_6_aggregate *__pyx_freelist_7sweepea___pyx_scope_struct_6_aggregate[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_6_aggregate = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_6_aggregate(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_6_aggregate > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_6_aggregate[--__pyx_freecount_7sweepea___pyx_scope_struct_6_aggregate];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate));
    (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_7sweepea___pyx_scope_struct_6_aggregate(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_name);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_6_aggregate < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_6_aggregate[__pyx_freecount_7sweepea___pyx_scope_struct_6_aggregate++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_6_aggregate(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate *)o;
  if (p->__pyx_v_name) {
    e = (*v)(p->__pyx_v_name, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_6_aggregate(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate *)o;
  tmp = ((PyObject*)p->__pyx_v_name);
  p->__pyx_v_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7sweepea_Database *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_6_aggregate = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_6_aggregate", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_6_aggregate), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_6_aggregate, /*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_7sweepea___pyx_scope_struct_6_aggregate, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_6_aggregate, /*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_7sweepea___pyx_scope_struct_6_aggregate, /*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_7sweepea___pyx_scope_struct_7_collation *__pyx_freelist_7sweepea___pyx_scope_struct_7_collation[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_7_collation = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_7_collation(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_7_collation > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_7_collation[--__pyx_freecount_7sweepea___pyx_scope_struct_7_collation];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation));
    (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_7sweepea___pyx_scope_struct_7_collation(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_name);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_7_collation < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_7_collation[__pyx_freecount_7sweepea___pyx_scope_struct_7_collation++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_7_collation(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation *)o;
  if (p->__pyx_v_name) {
    e = (*v)(p->__pyx_v_name, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_7_collation(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation *)o;
  tmp = ((PyObject*)p->__pyx_v_name);
  p->__pyx_v_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7sweepea_Database *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_7_collation = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_7_collation", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_7_collation), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_7_collation, /*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_7sweepea___pyx_scope_struct_7_collation, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_7_collation, /*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_7sweepea___pyx_scope_struct_7_collation, /*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_7sweepea___pyx_scope_struct_8_func *__pyx_freelist_7sweepea___pyx_scope_struct_8_func[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_8_func = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_8_func(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_8_func > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_8_func)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_8_func[--__pyx_freecount_7sweepea___pyx_scope_struct_8_func];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_8_func));
    (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_7sweepea___pyx_scope_struct_8_func(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_8_func *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_8_func *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_deterministic);
  Py_CLEAR(p->__pyx_v_n);
  Py_CLEAR(p->__pyx_v_name);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_8_func < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_8_func)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_8_func[__pyx_freecount_7sweepea___pyx_scope_struct_8_func++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_8_func *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_8_func(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_8_func *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_8_func *)o;
  if (p->__pyx_v_deterministic) {
    e = (*v)(p->__pyx_v_deterministic, a); if (e) return e;
  }
  if (p->__pyx_v_n) {
    e = (*v)(p->__pyx_v_n, a); if (e) return e;
  }
  if (p->__pyx_v_name) {
    e = (*v)(p->__pyx_v_name, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_8_func(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_8_func *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_8_func *)o;
  tmp = ((PyObject*)p->__pyx_v_deterministic);
  p->__pyx_v_deterministic = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_n);
  p->__pyx_v_n = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_name);
  p->__pyx_v_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7sweepea_Database *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_8_func = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_8_func", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_8_func), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_8_func, /*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_7sweepea___pyx_scope_struct_8_func, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_8_func, /*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_7sweepea___pyx_scope_struct_8_func, /*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_7sweepea___pyx_scope_struct_9_table_function *__pyx_freelist_7sweepea___pyx_scope_struct_9_table_function[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_9_table_function = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_9_table_function(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_9_table_function > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_9_table_function[--__pyx_freecount_7sweepea___pyx_scope_struct_9_table_function];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function));
    (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_7sweepea___pyx_scope_struct_9_table_function(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_name);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_9_table_function < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_9_table_function[__pyx_freecount_7sweepea___pyx_scope_struct_9_table_function++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_9_table_function(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function *)o;
  if (p->__pyx_v_name) {
    e = (*v)(p->__pyx_v_name, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject*)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_9_table_function(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function *)o;
  tmp = ((PyObject*)p->__pyx_v_name);
  p->__pyx_v_name = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_7sweepea_Database *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_9_table_function = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_9_table_function", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_9_table_function), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_9_table_function, /*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_7sweepea___pyx_scope_struct_9_table_function, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_9_table_function, /*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_7sweepea___pyx_scope_struct_9_table_function, /*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_7sweepea___pyx_scope_struct_10___scope_context__ *__pyx_freelist_7sweepea___pyx_scope_struct_10___scope_context__[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_10___scope_context__ = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_10___scope_context__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_10___scope_context__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_10___scope_context__)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_10___scope_context__[--__pyx_freecount_7sweepea___pyx_scope_struct_10___scope_context__];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_10___scope_context__));
    (void) PyObject_INIT(o, t);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_7sweepea___pyx_scope_struct_10___scope_context__(PyObject *o) {
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_10___scope_context__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_10___scope_context__)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_10___scope_context__[__pyx_freecount_7sweepea___pyx_scope_struct_10___scope_context__++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_10___scope_context__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_10___scope_context__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_10___scope_context__", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_10___scope_context__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_10___scope_context__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_7sweepea___pyx_scope_struct_10___scope_context__, /*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_7sweepea___pyx_scope_struct_11_inner *__pyx_freelist_7sweepea___pyx_scope_struct_11_inner[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_11_inner = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_11_inner(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_11_inner > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_11_inner[--__pyx_freecount_7sweepea___pyx_scope_struct_11_inner];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner));
    (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_7sweepea___pyx_scope_struct_11_inner(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_kwargs);
  Py_CLEAR(p->__pyx_v_self);
  Py_CLEAR(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_t_1);
  Py_CLEAR(p->__pyx_t_2);
  Py_CLEAR(p->__pyx_t_3);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_11_inner < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_11_inner[__pyx_freecount_7sweepea___pyx_scope_struct_11_inner++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_11_inner(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_kwargs) {
    e = (*v)(p->__pyx_v_kwargs, a); if (e) return e;
  }
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  if (p->__pyx_t_1) {
    e = (*v)(p->__pyx_t_1, a); if (e) return e;
  }
  if (p->__pyx_t_2) {
    e = (*v)(p->__pyx_t_2, a); if (e) return e;
  }
  if (p->__pyx_t_3) {
    e = (*v)(p->__pyx_t_3, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_11_inner(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7sweepea___pyx_scope_struct_10___scope_context__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_kwargs);
  p->__pyx_v_kwargs = ((PyObject*)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);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_1);
  p->__pyx_t_1 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_2);
  p->__pyx_t_2 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_t_3);
  p->__pyx_t_3 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_11_inner = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_11_inner", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_11_inner), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_11_inner, /*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_7sweepea___pyx_scope_struct_11_inner, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_11_inner, /*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_7sweepea___pyx_scope_struct_11_inner, /*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_7sweepea___pyx_scope_struct_12_copy *__pyx_freelist_7sweepea___pyx_scope_struct_12_copy[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_12_copy = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_12_copy(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_12_copy > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_12_copy[--__pyx_freecount_7sweepea___pyx_scope_struct_12_copy];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy));
    (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_7sweepea___pyx_scope_struct_12_copy(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_method);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_12_copy < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_12_copy[__pyx_freecount_7sweepea___pyx_scope_struct_12_copy++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_12_copy(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy *)o;
  if (p->__pyx_v_method) {
    e = (*v)(p->__pyx_v_method, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_12_copy(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy *)o;
  tmp = ((PyObject*)p->__pyx_v_method);
  p->__pyx_v_method = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_12_copy = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_12_copy", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_12_copy), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_12_copy, /*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_7sweepea___pyx_scope_struct_12_copy, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_12_copy, /*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_7sweepea___pyx_scope_struct_12_copy, /*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_7sweepea___pyx_scope_struct_13___e__ *__pyx_freelist_7sweepea___pyx_scope_struct_13___e__[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_13___e__ = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_13___e__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_13___e__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_13___e__[--__pyx_freecount_7sweepea___pyx_scope_struct_13___e__];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__));
    (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_7sweepea___pyx_scope_struct_13___e__(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_inv);
  Py_CLEAR(p->__pyx_v_op);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_13___e__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_13___e__[__pyx_freecount_7sweepea___pyx_scope_struct_13___e__++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_13___e__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__ *)o;
  if (p->__pyx_v_inv) {
    e = (*v)(p->__pyx_v_inv, a); if (e) return e;
  }
  if (p->__pyx_v_op) {
    e = (*v)(p->__pyx_v_op, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_13___e__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__ *)o;
  tmp = ((PyObject*)p->__pyx_v_inv);
  p->__pyx_v_inv = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_op);
  p->__pyx_v_op = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_13___e__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_13___e__", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_13___e__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_13___e__, /*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_7sweepea___pyx_scope_struct_13___e__, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_13___e__, /*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_7sweepea___pyx_scope_struct_13___e__, /*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_7sweepea___pyx_scope_struct_14___init__ *__pyx_freelist_7sweepea___pyx_scope_struct_14___init__[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_14___init__ = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_14___init__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_14___init__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_14___init__[--__pyx_freecount_7sweepea___pyx_scope_struct_14___init__];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__));
    (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_7sweepea___pyx_scope_struct_14___init__(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_14___init__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_14___init__[__pyx_freecount_7sweepea___pyx_scope_struct_14___init__++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_14___init__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_14___init__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__ *)o;
  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_7sweepea___pyx_scope_struct_14___init__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_14___init__", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_14___init__, /*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_7sweepea___pyx_scope_struct_14___init__, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_14___init__, /*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_7sweepea___pyx_scope_struct_14___init__, /*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_7sweepea___pyx_scope_struct_15_genexpr *__pyx_freelist_7sweepea___pyx_scope_struct_15_genexpr[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_15_genexpr = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_15_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_15_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_15_genexpr[--__pyx_freecount_7sweepea___pyx_scope_struct_15_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_15_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_7sweepea___pyx_scope_struct_15_genexpr(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_part);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_15_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_15_genexpr[__pyx_freecount_7sweepea___pyx_scope_struct_15_genexpr++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_15_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_part) {
    e = (*v)(p->__pyx_v_part, 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_7sweepea___pyx_scope_struct_15_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7sweepea___pyx_scope_struct_14___init__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_part);
  p->__pyx_v_part = 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_7sweepea___pyx_scope_struct_15_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_15_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_15_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_15_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_7sweepea___pyx_scope_struct_15_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_15_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_7sweepea___pyx_scope_struct_15_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_7sweepea___pyx_scope_struct_16___getattr__ *__pyx_freelist_7sweepea___pyx_scope_struct_16___getattr__[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_16___getattr__ = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_16___getattr__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_16___getattr__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_16___getattr__[--__pyx_freecount_7sweepea___pyx_scope_struct_16___getattr__];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__));
    (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_7sweepea___pyx_scope_struct_16___getattr__(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_attr);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_16___getattr__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_16___getattr__[__pyx_freecount_7sweepea___pyx_scope_struct_16___getattr__++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_16___getattr__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__ *)o;
  if (p->__pyx_v_attr) {
    e = (*v)(p->__pyx_v_attr, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_16___getattr__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__ *)o;
  tmp = ((PyObject*)p->__pyx_v_attr);
  p->__pyx_v_attr = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_16___getattr__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_16___getattr__", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_16___getattr__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_16___getattr__, /*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_7sweepea___pyx_scope_struct_16___getattr__, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_16___getattr__, /*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_7sweepea___pyx_scope_struct_16___getattr__, /*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_7sweepea___pyx_scope_struct_17___sql__ *__pyx_freelist_7sweepea___pyx_scope_struct_17___sql__[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_17___sql__ = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_17___sql__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_17___sql__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_17___sql__[--__pyx_freecount_7sweepea___pyx_scope_struct_17___sql__];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__));
    (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_7sweepea___pyx_scope_struct_17___sql__(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__ *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_17___sql__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_17___sql__[__pyx_freecount_7sweepea___pyx_scope_struct_17___sql__++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_17___sql__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(p->__pyx_v_self, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_17___sql__(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__ *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__ *)o;
  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_7sweepea___pyx_scope_struct_17___sql__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_17___sql__", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_17___sql__, /*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_7sweepea___pyx_scope_struct_17___sql__, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_17___sql__, /*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_7sweepea___pyx_scope_struct_17___sql__, /*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_7sweepea___pyx_scope_struct_18_genexpr *__pyx_freelist_7sweepea___pyx_scope_struct_18_genexpr[8];
static int __pyx_freecount_7sweepea___pyx_scope_struct_18_genexpr = 0;

static PyObject *__pyx_tp_new_7sweepea___pyx_scope_struct_18_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_7sweepea___pyx_scope_struct_18_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr)))) {
    o = (PyObject*)__pyx_freelist_7sweepea___pyx_scope_struct_18_genexpr[--__pyx_freecount_7sweepea___pyx_scope_struct_18_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_18_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_7sweepea___pyx_scope_struct_18_genexpr(PyObject *o) {
  struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_cte);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_7sweepea___pyx_scope_struct_18_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr)))) {
    __pyx_freelist_7sweepea___pyx_scope_struct_18_genexpr[__pyx_freecount_7sweepea___pyx_scope_struct_18_genexpr++] = ((struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_7sweepea___pyx_scope_struct_18_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject*)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_cte) {
    e = (*v)(p->__pyx_v_cte, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_7sweepea___pyx_scope_struct_18_genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr *p = (struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr *)o;
  tmp = ((PyObject*)p->__pyx_outer_scope);
  p->__pyx_outer_scope = ((struct __pyx_obj_7sweepea___pyx_scope_struct_17___sql__ *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_cte);
  p->__pyx_v_cte = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_7sweepea___pyx_scope_struct_18_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct_18_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_7sweepea___pyx_scope_struct_18_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_7sweepea___pyx_scope_struct_18_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_7sweepea___pyx_scope_struct_18_genexpr, /*tp_traverse*/
  __pyx_tp_clear_7sweepea___pyx_scope_struct_18_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_7sweepea___pyx_scope_struct_18_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___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py[8];
static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py = 0;

static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py)))) {
    o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py];
    memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py));
    (void) PyObject_INIT(o, t);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py(PyObject *o) {
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py)))) {
    __pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static PyTypeObject __pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py", /*tp_name*/
  sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py, /*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___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py[8];
static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py = 0;

static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py)))) {
    o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py];
    memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py));
    (void) PyObject_INIT(o, t);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py(PyObject *o) {
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py)))) {
    __pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static PyTypeObject __pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py", /*tp_name*/
  sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py, /*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___pyx_scope_struct____Pyx_CFunc_float____object___to_py *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_float____object___to_py[8];
static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_float____object___to_py = 0;

static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_float____object___to_py(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_float____object___to_py > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object___to_py)))) {
    o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_float____object___to_py[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_float____object___to_py];
    memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object___to_py));
    (void) PyObject_INIT(o, t);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_float____object___to_py(PyObject *o) {
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_float____object___to_py < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object___to_py)))) {
    __pyx_freelist___pyx_scope_struct____Pyx_CFunc_float____object___to_py[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_float____object___to_py++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object___to_py *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static PyTypeObject __pyx_scope_struct____Pyx_CFunc_float____object___to_py = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct____Pyx_CFunc_float____object___to_py", /*tp_name*/
  sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object___to_py), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_float____object___to_py, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_float____object___to_py, /*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___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py[8];
static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py = 0;

static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py)))) {
    o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py];
    memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py));
    (void) PyObject_INIT(o, t);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py(PyObject *o) {
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py)))) {
    __pyx_freelist___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static PyTypeObject __pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py", /*tp_name*/
  sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py, /*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___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py[8];
static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py = 0;

static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py)))) {
    o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py];
    memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py));
    (void) PyObject_INIT(o, t);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py(PyObject *o) {
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py)))) {
    __pyx_freelist___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static PyTypeObject __pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py = {
  PyVarObject_HEAD_INIT(0, 0)
  "sweepea.__pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py", /*tp_name*/
  sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py, /*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[] = {
  {"format_datetime", (PyCFunction)__pyx_pw_7sweepea_25format_datetime, METH_O, 0},
  {"format_date", (PyCFunction)__pyx_pw_7sweepea_27format_date, METH_O, 0},
  {"format_time", (PyCFunction)__pyx_pw_7sweepea_29format_time, METH_O, 0},
  {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
    "sweepea",
    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_n_s_AND, __pyx_k_AND, sizeof(__pyx_k_AND), 0, 0, 1, 1},
  {&__pyx_kp_s_AS, __pyx_k_AS, sizeof(__pyx_k_AS), 0, 0, 1, 0},
  {&__pyx_n_s_ASC, __pyx_k_ASC, sizeof(__pyx_k_ASC), 0, 0, 1, 1},
  {&__pyx_kp_s_AS_2, __pyx_k_AS_2, sizeof(__pyx_k_AS_2), 0, 0, 1, 0},
  {&__pyx_kp_s_AS_s, __pyx_k_AS_s, sizeof(__pyx_k_AS_s), 0, 0, 1, 0},
  {&__pyx_kp_s_AS_s_2, __pyx_k_AS_s_2, sizeof(__pyx_k_AS_s_2), 0, 0, 1, 0},
  {&__pyx_n_s_Alias, __pyx_k_Alias, sizeof(__pyx_k_Alias), 0, 0, 1, 1},
  {&__pyx_n_s_Alias___init, __pyx_k_Alias___init, sizeof(__pyx_k_Alias___init), 0, 0, 1, 1},
  {&__pyx_n_s_Alias___sql, __pyx_k_Alias___sql, sizeof(__pyx_k_Alias___sql), 0, 0, 1, 1},
  {&__pyx_n_s_Alias_alias, __pyx_k_Alias_alias, sizeof(__pyx_k_Alias_alias), 0, 0, 1, 1},
  {&__pyx_n_s_Asc, __pyx_k_Asc, sizeof(__pyx_k_Asc), 0, 0, 1, 1},
  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  {&__pyx_n_s_BEGIN, __pyx_k_BEGIN, sizeof(__pyx_k_BEGIN), 0, 0, 1, 1},
  {&__pyx_kp_s_BEGIN_s, __pyx_k_BEGIN_s, sizeof(__pyx_k_BEGIN_s), 0, 0, 1, 0},
  {&__pyx_n_s_BETWEEN, __pyx_k_BETWEEN, sizeof(__pyx_k_BETWEEN), 0, 0, 1, 1},
  {&__pyx_kp_s_CAST, __pyx_k_CAST, sizeof(__pyx_k_CAST), 0, 0, 1, 0},
  {&__pyx_kp_s_CHECK_s, __pyx_k_CHECK_s, sizeof(__pyx_k_CHECK_s), 0, 0, 1, 0},
  {&__pyx_kp_s_COLLATE_s, __pyx_k_COLLATE_s, sizeof(__pyx_k_COLLATE_s), 0, 0, 1, 0},
  {&__pyx_kp_s_CREATE_TABLE_x_s, __pyx_k_CREATE_TABLE_x_s, sizeof(__pyx_k_CREATE_TABLE_x_s), 0, 0, 1, 0},
  {&__pyx_n_s_CTE, __pyx_k_CTE, sizeof(__pyx_k_CTE), 0, 0, 1, 1},
  {&__pyx_n_s_CTE___init, __pyx_k_CTE___init, sizeof(__pyx_k_CTE___init), 0, 0, 1, 1},
  {&__pyx_n_s_CTE___sql, __pyx_k_CTE___sql, sizeof(__pyx_k_CTE___sql), 0, 0, 1, 1},
  {&__pyx_kp_s_Cannot_operate_on_closed_databas, __pyx_k_Cannot_operate_on_closed_databas, sizeof(__pyx_k_Cannot_operate_on_closed_databas), 0, 0, 1, 0},
  {&__pyx_n_s_Cast, __pyx_k_Cast, sizeof(__pyx_k_Cast), 0, 0, 1, 1},
  {&__pyx_n_s_Cast___init, __pyx_k_Cast___init, sizeof(__pyx_k_Cast___init), 0, 0, 1, 1},
  {&__pyx_n_s_Cast___sql, __pyx_k_Cast___sql, sizeof(__pyx_k_Cast___sql), 0, 0, 1, 1},
  {&__pyx_n_s_Check, __pyx_k_Check, sizeof(__pyx_k_Check), 0, 0, 1, 1},
  {&__pyx_n_s_Column, __pyx_k_Column, sizeof(__pyx_k_Column), 0, 0, 1, 1},
  {&__pyx_n_s_Column___init, __pyx_k_Column___init, sizeof(__pyx_k_Column___init), 0, 0, 1, 1},
  {&__pyx_n_s_Column___sql, __pyx_k_Column___sql, sizeof(__pyx_k_Column___sql), 0, 0, 1, 1},
  {&__pyx_kp_s_Column_must_be_either_a_string_o, __pyx_k_Column_must_be_either_a_string_o, sizeof(__pyx_k_Column_must_be_either_a_string_o), 0, 0, 1, 0},
  {&__pyx_n_s_CommaList, __pyx_k_CommaList, sizeof(__pyx_k_CommaList), 0, 0, 1, 1},
  {&__pyx_n_s_CompoundSelect, __pyx_k_CompoundSelect, sizeof(__pyx_k_CompoundSelect), 0, 0, 1, 1},
  {&__pyx_n_s_CompoundSelect___init, __pyx_k_CompoundSelect___init, sizeof(__pyx_k_CompoundSelect___init), 0, 0, 1, 1},
  {&__pyx_n_s_CompoundSelect___sql, __pyx_k_CompoundSelect___sql, sizeof(__pyx_k_CompoundSelect___sql), 0, 0, 1, 1},
  {&__pyx_n_s_CompoundSelect_execute, __pyx_k_CompoundSelect_execute, sizeof(__pyx_k_CompoundSelect_execute), 0, 0, 1, 1},
  {&__pyx_n_s_ConnectionLocal, __pyx_k_ConnectionLocal, sizeof(__pyx_k_ConnectionLocal), 0, 0, 1, 1},
  {&__pyx_n_s_ConnectionLocal___init, __pyx_k_ConnectionLocal___init, sizeof(__pyx_k_ConnectionLocal___init), 0, 0, 1, 1},
  {&__pyx_kp_s_Connection_already_open_in_this, __pyx_k_Connection_already_open_in_this, sizeof(__pyx_k_Connection_already_open_in_this), 0, 0, 1, 0},
  {&__pyx_kp_s_Connection_not_initialized, __pyx_k_Connection_not_initialized, sizeof(__pyx_k_Connection_not_initialized), 0, 0, 1, 0},
  {&__pyx_n_s_CursorWrapper_iterator, __pyx_k_CursorWrapper_iterator, sizeof(__pyx_k_CursorWrapper_iterator), 0, 0, 1, 1},
  {&__pyx_n_s_DATE, __pyx_k_DATE, sizeof(__pyx_k_DATE), 0, 0, 1, 1},
  {&__pyx_n_s_DATETIME, __pyx_k_DATETIME, sizeof(__pyx_k_DATETIME), 0, 0, 1, 1},
  {&__pyx_kp_s_DEFAULT_VALUES, __pyx_k_DEFAULT_VALUES, sizeof(__pyx_k_DEFAULT_VALUES), 0, 0, 1, 0},
  {&__pyx_n_s_DEFERRED, __pyx_k_DEFERRED, sizeof(__pyx_k_DEFERRED), 0, 0, 1, 1},
  {&__pyx_n_s_DELETE, __pyx_k_DELETE, sizeof(__pyx_k_DELETE), 0, 0, 1, 1},
  {&__pyx_kp_s_DELETE_FROM, __pyx_k_DELETE_FROM, sizeof(__pyx_k_DELETE_FROM), 0, 0, 1, 0},
  {&__pyx_n_s_DESC, __pyx_k_DESC, sizeof(__pyx_k_DESC), 0, 0, 1, 1},
  {&__pyx_n_s_DatabaseError, __pyx_k_DatabaseError, sizeof(__pyx_k_DatabaseError), 0, 0, 1, 1},
  {&__pyx_kp_s_Database_has_not_been_initialize, __pyx_k_Database_has_not_been_initialize, sizeof(__pyx_k_Database_has_not_been_initialize), 0, 0, 1, 0},
  {&__pyx_n_s_Decimal, __pyx_k_Decimal, sizeof(__pyx_k_Decimal), 0, 0, 1, 1},
  {&__pyx_n_s_Delete, __pyx_k_Delete, sizeof(__pyx_k_Delete), 0, 0, 1, 1},
  {&__pyx_n_s_Delete___init, __pyx_k_Delete___init, sizeof(__pyx_k_Delete___init), 0, 0, 1, 1},
  {&__pyx_n_s_Delete___sql, __pyx_k_Delete___sql, sizeof(__pyx_k_Delete___sql), 0, 0, 1, 1},
  {&__pyx_n_s_Delete_execute, __pyx_k_Delete_execute, sizeof(__pyx_k_Delete_execute), 0, 0, 1, 1},
  {&__pyx_n_s_Delete_where, __pyx_k_Delete_where, sizeof(__pyx_k_Delete_where), 0, 0, 1, 1},
  {&__pyx_n_s_Desc, __pyx_k_Desc, sizeof(__pyx_k_Desc), 0, 0, 1, 1},
  {&__pyx_n_s_DictCursorWrapper, __pyx_k_DictCursorWrapper, sizeof(__pyx_k_DictCursorWrapper), 0, 0, 1, 1},
  {&__pyx_n_s_EXCEPT, __pyx_k_EXCEPT, sizeof(__pyx_k_EXCEPT), 0, 0, 1, 1},
  {&__pyx_n_s_EnclosedList, __pyx_k_EnclosedList, sizeof(__pyx_k_EnclosedList), 0, 0, 1, 1},
  {&__pyx_n_s_Entity, __pyx_k_Entity, sizeof(__pyx_k_Entity), 0, 0, 1, 1},
  {&__pyx_n_s_EntityBase, __pyx_k_EntityBase, sizeof(__pyx_k_EntityBase), 0, 0, 1, 1},
  {&__pyx_n_s_EntityBase___e, __pyx_k_EntityBase___e, sizeof(__pyx_k_EntityBase___e), 0, 0, 1, 1},
  {&__pyx_n_s_EntityBase___e___locals_inner, __pyx_k_EntityBase___e___locals_inner, sizeof(__pyx_k_EntityBase___e___locals_inner), 0, 0, 1, 1},
  {&__pyx_n_s_EntityBase___eq, __pyx_k_EntityBase___eq, sizeof(__pyx_k_EntityBase___eq), 0, 0, 1, 1},
  {&__pyx_n_s_EntityBase___inv, __pyx_k_EntityBase___inv, sizeof(__pyx_k_EntityBase___inv), 0, 0, 1, 1},
  {&__pyx_n_s_EntityBase___ne, __pyx_k_EntityBase___ne, sizeof(__pyx_k_EntityBase___ne), 0, 0, 1, 1},
  {&__pyx_n_s_EntityBase___neg, __pyx_k_EntityBase___neg, sizeof(__pyx_k_EntityBase___neg), 0, 0, 1, 1},
  {&__pyx_n_s_EntityBase___pos, __pyx_k_EntityBase___pos, sizeof(__pyx_k_EntityBase___pos), 0, 0, 1, 1},
  {&__pyx_n_s_EntityBase_alias, __pyx_k_EntityBase_alias, sizeof(__pyx_k_EntityBase_alias), 0, 0, 1, 1},
  {&__pyx_n_s_EntityBase_asc, __pyx_k_EntityBase_asc, sizeof(__pyx_k_EntityBase_asc), 0, 0, 1, 1},
  {&__pyx_n_s_EntityBase_between, __pyx_k_EntityBase_between, sizeof(__pyx_k_EntityBase_between), 0, 0, 1, 1},
  {&__pyx_n_s_EntityBase_desc, __pyx_k_EntityBase_desc, sizeof(__pyx_k_EntityBase_desc), 0, 0, 1, 1},
  {&__pyx_n_s_EntityBase_is_null, __pyx_k_EntityBase_is_null, sizeof(__pyx_k_EntityBase_is_null), 0, 0, 1, 1},
  {&__pyx_n_s_EntityWrapper, __pyx_k_EntityWrapper, sizeof(__pyx_k_EntityWrapper), 0, 0, 1, 1},
  {&__pyx_n_s_EntityWrapper___init, __pyx_k_EntityWrapper___init, sizeof(__pyx_k_EntityWrapper___init), 0, 0, 1, 1},
  {&__pyx_n_s_Entity___init, __pyx_k_Entity___init, sizeof(__pyx_k_Entity___init), 0, 0, 1, 1},
  {&__pyx_n_s_Entity___init___locals_genexpr, __pyx_k_Entity___init___locals_genexpr, sizeof(__pyx_k_Entity___init___locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_Entity___sql, __pyx_k_Entity___sql, sizeof(__pyx_k_Entity___sql), 0, 0, 1, 1},
  {&__pyx_kp_s_Error_calling_sqlite3_create_fun, __pyx_k_Error_calling_sqlite3_create_fun, sizeof(__pyx_k_Error_calling_sqlite3_create_fun), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_requesting_db_status_s, __pyx_k_Error_requesting_db_status_s, sizeof(__pyx_k_Error_requesting_db_status_s), 0, 0, 1, 0},
  {&__pyx_kp_s_Error_requesting_status_s, __pyx_k_Error_requesting_status_s, sizeof(__pyx_k_Error_requesting_status_s), 0, 0, 1, 0},
  {&__pyx_n_s_Exception, __pyx_k_Exception, sizeof(__pyx_k_Exception), 0, 0, 1, 1},
  {&__pyx_n_s_Expression, __pyx_k_Expression, sizeof(__pyx_k_Expression), 0, 0, 1, 1},
  {&__pyx_n_s_Expression___init, __pyx_k_Expression___init, sizeof(__pyx_k_Expression___init), 0, 0, 1, 1},
  {&__pyx_n_s_Expression___sql, __pyx_k_Expression___sql, sizeof(__pyx_k_Expression___sql), 0, 0, 1, 1},
  {&__pyx_kp_s_FROM, __pyx_k_FROM, sizeof(__pyx_k_FROM), 0, 0, 1, 0},
  {&__pyx_n_s_Function, __pyx_k_Function, sizeof(__pyx_k_Function), 0, 0, 1, 1},
  {&__pyx_n_s_Function___getattr, __pyx_k_Function___getattr, sizeof(__pyx_k_Function___getattr), 0, 0, 1, 1},
  {&__pyx_n_s_Function___getattr___locals_deco, __pyx_k_Function___getattr___locals_deco, sizeof(__pyx_k_Function___getattr___locals_deco), 0, 0, 1, 1},
  {&__pyx_n_s_Function___init, __pyx_k_Function___init, sizeof(__pyx_k_Function___init), 0, 0, 1, 1},
  {&__pyx_n_s_Function___sql, __pyx_k_Function___sql, sizeof(__pyx_k_Function___sql), 0, 0, 1, 1},
  {&__pyx_n_s_GLOB, __pyx_k_GLOB, sizeof(__pyx_k_GLOB), 0, 0, 1, 1},
  {&__pyx_kp_s_GROUP_BY, __pyx_k_GROUP_BY, sizeof(__pyx_k_GROUP_BY), 0, 0, 1, 0},
  {&__pyx_kp_s_HAVING, __pyx_k_HAVING, sizeof(__pyx_k_HAVING), 0, 0, 1, 0},
  {&__pyx_kp_s_H_M, __pyx_k_H_M, sizeof(__pyx_k_H_M), 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_kp_s_I, __pyx_k_I, sizeof(__pyx_k_I), 0, 0, 1, 0},
  {&__pyx_n_s_IN, __pyx_k_IN, sizeof(__pyx_k_IN), 0, 0, 1, 1},
  {&__pyx_n_s_INNER, __pyx_k_INNER, sizeof(__pyx_k_INNER), 0, 0, 1, 1},
  {&__pyx_n_s_INSERT, __pyx_k_INSERT, sizeof(__pyx_k_INSERT), 0, 0, 1, 1},
  {&__pyx_kp_s_INSERT_2, __pyx_k_INSERT_2, sizeof(__pyx_k_INSERT_2), 0, 0, 1, 0},
  {&__pyx_n_s_INTERSECT, __pyx_k_INTERSECT, sizeof(__pyx_k_INTERSECT), 0, 0, 1, 1},
  {&__pyx_kp_s_INTO, __pyx_k_INTO, sizeof(__pyx_k_INTO), 0, 0, 1, 0},
  {&__pyx_n_s_IS, __pyx_k_IS, sizeof(__pyx_k_IS), 0, 0, 1, 1},
  {&__pyx_kp_s_IS_NOT, __pyx_k_IS_NOT, sizeof(__pyx_k_IS_NOT), 0, 0, 1, 0},
  {&__pyx_n_s_I_2, __pyx_k_I_2, sizeof(__pyx_k_I_2), 0, 0, 1, 1},
  {&__pyx_kp_s_Implements_a_table_valued_funct, __pyx_k_Implements_a_table_valued_funct, sizeof(__pyx_k_Implements_a_table_valued_funct), 0, 0, 1, 0},
  {&__pyx_n_s_Insert, __pyx_k_Insert, sizeof(__pyx_k_Insert), 0, 0, 1, 1},
  {&__pyx_n_s_Insert___init, __pyx_k_Insert___init, sizeof(__pyx_k_Insert___init), 0, 0, 1, 1},
  {&__pyx_n_s_Insert___sql, __pyx_k_Insert___sql, sizeof(__pyx_k_Insert___sql), 0, 0, 1, 1},
  {&__pyx_n_s_Insert__multi_insert, __pyx_k_Insert__multi_insert, sizeof(__pyx_k_Insert__multi_insert), 0, 0, 1, 1},
  {&__pyx_n_s_Insert__query_insert, __pyx_k_Insert__query_insert, sizeof(__pyx_k_Insert__query_insert), 0, 0, 1, 1},
  {&__pyx_n_s_Insert__simple_insert, __pyx_k_Insert__simple_insert, sizeof(__pyx_k_Insert__simple_insert), 0, 0, 1, 1},
  {&__pyx_n_s_Insert_execute, __pyx_k_Insert_execute, sizeof(__pyx_k_Insert_execute), 0, 0, 1, 1},
  {&__pyx_n_s_Insert_on_conflict, __pyx_k_Insert_on_conflict, sizeof(__pyx_k_Insert_on_conflict), 0, 0, 1, 1},
  {&__pyx_n_s_InterfaceError, __pyx_k_InterfaceError, sizeof(__pyx_k_InterfaceError), 0, 0, 1, 1},
  {&__pyx_n_s_Join, __pyx_k_Join, sizeof(__pyx_k_Join), 0, 0, 1, 1},
  {&__pyx_n_s_Join___init, __pyx_k_Join___init, sizeof(__pyx_k_Join___init), 0, 0, 1, 1},
  {&__pyx_n_s_Join___sql, __pyx_k_Join___sql, sizeof(__pyx_k_Join___sql), 0, 0, 1, 1},
  {&__pyx_n_s_Join_on, __pyx_k_Join_on, sizeof(__pyx_k_Join_on), 0, 0, 1, 1},
  {&__pyx_kp_s_LEFT_OUTER, __pyx_k_LEFT_OUTER, sizeof(__pyx_k_LEFT_OUTER), 0, 0, 1, 0},
  {&__pyx_n_s_LIKE, __pyx_k_LIKE, sizeof(__pyx_k_LIKE), 0, 0, 1, 1},
  {&__pyx_kp_s_LIMIT_d, __pyx_k_LIMIT_d, sizeof(__pyx_k_LIMIT_d), 0, 0, 1, 0},
  {&__pyx_n_s_List, __pyx_k_List, sizeof(__pyx_k_List), 0, 0, 1, 1},
  {&__pyx_n_s_List___init, __pyx_k_List___init, sizeof(__pyx_k_List___init), 0, 0, 1, 1},
  {&__pyx_n_s_List___sql, __pyx_k_List___sql, sizeof(__pyx_k_List___sql), 0, 0, 1, 1},
  {&__pyx_n_s_Lock, __pyx_k_Lock, sizeof(__pyx_k_Lock), 0, 0, 1, 1},
  {&__pyx_kp_s_NOT, __pyx_k_NOT, sizeof(__pyx_k_NOT), 0, 0, 1, 0},
  {&__pyx_kp_s_NOT_IN, __pyx_k_NOT_IN, sizeof(__pyx_k_NOT_IN), 0, 0, 1, 0},
  {&__pyx_kp_s_NULLS_s, __pyx_k_NULLS_s, sizeof(__pyx_k_NULLS_s), 0, 0, 1, 0},
  {&__pyx_n_s_Negated, __pyx_k_Negated, sizeof(__pyx_k_Negated), 0, 0, 1, 1},
  {&__pyx_n_s_Negated___invert, __pyx_k_Negated___invert, sizeof(__pyx_k_Negated___invert), 0, 0, 1, 1},
  {&__pyx_n_s_Negated___sql, __pyx_k_Negated___sql, sizeof(__pyx_k_Negated___sql), 0, 0, 1, 1},
  {&__pyx_kp_s_No_sources_to_join_on, __pyx_k_No_sources_to_join_on, sizeof(__pyx_k_No_sources_to_join_on), 0, 0, 1, 0},
  {&__pyx_n_s_Node, __pyx_k_Node, sizeof(__pyx_k_Node), 0, 0, 1, 1},
  {&__pyx_n_s_Node_clone, __pyx_k_Node_clone, sizeof(__pyx_k_Node_clone), 0, 0, 1, 1},
  {&__pyx_n_s_Node_copy, __pyx_k_Node_copy, sizeof(__pyx_k_Node_copy), 0, 0, 1, 1},
  {&__pyx_n_s_Node_copy_locals_inner, __pyx_k_Node_copy_locals_inner, sizeof(__pyx_k_Node_copy_locals_inner), 0, 0, 1, 1},
  {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
  {&__pyx_kp_s_OFFSET_d, __pyx_k_OFFSET_d, sizeof(__pyx_k_OFFSET_d), 0, 0, 1, 0},
  {&__pyx_kp_s_ON, __pyx_k_ON, sizeof(__pyx_k_ON), 0, 0, 1, 0},
  {&__pyx_n_s_OR, __pyx_k_OR, sizeof(__pyx_k_OR), 0, 0, 1, 1},
  {&__pyx_kp_s_ORDER_BY, __pyx_k_ORDER_BY, sizeof(__pyx_k_ORDER_BY), 0, 0, 1, 0},
  {&__pyx_kp_s_OR_s, __pyx_k_OR_s, sizeof(__pyx_k_OR_s), 0, 0, 1, 0},
  {&__pyx_n_s_OperationalError, __pyx_k_OperationalError, sizeof(__pyx_k_OperationalError), 0, 0, 1, 1},
  {&__pyx_n_s_Ordering, __pyx_k_Ordering, sizeof(__pyx_k_Ordering), 0, 0, 1, 1},
  {&__pyx_n_s_Ordering___init, __pyx_k_Ordering___init, sizeof(__pyx_k_Ordering___init), 0, 0, 1, 1},
  {&__pyx_n_s_Ordering___sql, __pyx_k_Ordering___sql, sizeof(__pyx_k_Ordering___sql), 0, 0, 1, 1},
  {&__pyx_n_s_Ordering_collate, __pyx_k_Ordering_collate, sizeof(__pyx_k_Ordering_collate), 0, 0, 1, 1},
  {&__pyx_n_s_PARSE_DECLTYPES, __pyx_k_PARSE_DECLTYPES, sizeof(__pyx_k_PARSE_DECLTYPES), 0, 0, 1, 1},
  {&__pyx_kp_s_PRAGMA_foreign_key_list_s, __pyx_k_PRAGMA_foreign_key_list_s, sizeof(__pyx_k_PRAGMA_foreign_key_list_s), 0, 0, 1, 0},
  {&__pyx_kp_s_PRAGMA_index_info_s, __pyx_k_PRAGMA_index_info_s, sizeof(__pyx_k_PRAGMA_index_info_s), 0, 0, 1, 0},
  {&__pyx_kp_s_PRAGMA_index_list_s, __pyx_k_PRAGMA_index_list_s, sizeof(__pyx_k_PRAGMA_index_list_s), 0, 0, 1, 0},
  {&__pyx_kp_s_PRAGMA_s, __pyx_k_PRAGMA_s, sizeof(__pyx_k_PRAGMA_s), 0, 0, 1, 0},
  {&__pyx_kp_s_PRAGMA_s_s, __pyx_k_PRAGMA_s_s, sizeof(__pyx_k_PRAGMA_s_s), 0, 0, 1, 0},
  {&__pyx_kp_s_PRAGMA_table_info_s, __pyx_k_PRAGMA_table_info_s, sizeof(__pyx_k_PRAGMA_table_info_s), 0, 0, 1, 0},
  {&__pyx_n_s_Pyx_CFunc_bint____basestring, __pyx_k_Pyx_CFunc_bint____basestring, sizeof(__pyx_k_Pyx_CFunc_bint____basestring), 0, 0, 1, 1},
  {&__pyx_n_s_Pyx_CFunc_float____object____i, __pyx_k_Pyx_CFunc_float____object____i, sizeof(__pyx_k_Pyx_CFunc_float____object____i), 0, 0, 1, 1},
  {&__pyx_n_s_Pyx_CFunc_float____object___to, __pyx_k_Pyx_CFunc_float____object___to, sizeof(__pyx_k_Pyx_CFunc_float____object___to), 0, 0, 1, 1},
  {&__pyx_n_s_Pyx_CFunc_object____CursorWrap, __pyx_k_Pyx_CFunc_object____CursorWrap, sizeof(__pyx_k_Pyx_CFunc_object____CursorWrap), 0, 0, 1, 1},
  {&__pyx_n_s_Pyx_CFunc_object____NamedTuple, __pyx_k_Pyx_CFunc_object____NamedTuple, sizeof(__pyx_k_Pyx_CFunc_object____NamedTuple), 0, 0, 1, 1},
  {&__pyx_n_s_Query, __pyx_k_Query, sizeof(__pyx_k_Query), 0, 0, 1, 1},
  {&__pyx_n_s_Query___init, __pyx_k_Query___init, sizeof(__pyx_k_Query___init), 0, 0, 1, 1},
  {&__pyx_n_s_Query___sql, __pyx_k_Query___sql, sizeof(__pyx_k_Query___sql), 0, 0, 1, 1},
  {&__pyx_n_s_Query___sql___locals_genexpr, __pyx_k_Query___sql___locals_genexpr, sizeof(__pyx_k_Query___sql___locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_Query_apply_ordering, __pyx_k_Query_apply_ordering, sizeof(__pyx_k_Query_apply_ordering), 0, 0, 1, 1},
  {&__pyx_n_s_Query_clone, __pyx_k_Query_clone, sizeof(__pyx_k_Query_clone), 0, 0, 1, 1},
  {&__pyx_n_s_Query_execute, __pyx_k_Query_execute, sizeof(__pyx_k_Query_execute), 0, 0, 1, 1},
  {&__pyx_n_s_Query_limit, __pyx_k_Query_limit, sizeof(__pyx_k_Query_limit), 0, 0, 1, 1},
  {&__pyx_n_s_Query_offset, __pyx_k_Query_offset, sizeof(__pyx_k_Query_offset), 0, 0, 1, 1},
  {&__pyx_n_s_Query_order_by, __pyx_k_Query_order_by, sizeof(__pyx_k_Query_order_by), 0, 0, 1, 1},
  {&__pyx_n_s_Query_order_by_extend, __pyx_k_Query_order_by_extend, sizeof(__pyx_k_Query_order_by_extend), 0, 0, 1, 1},
  {&__pyx_n_s_Query_paginate, __pyx_k_Query_paginate, sizeof(__pyx_k_Query_paginate), 0, 0, 1, 1},
  {&__pyx_n_s_Query_with, __pyx_k_Query_with, sizeof(__pyx_k_Query_with), 0, 0, 1, 1},
  {&__pyx_kp_s_RELEASE_SAVEPOINT_s, __pyx_k_RELEASE_SAVEPOINT_s, sizeof(__pyx_k_RELEASE_SAVEPOINT_s), 0, 0, 1, 0},
  {&__pyx_kp_s_ROLLBACK_TO_SAVEPOINT_s, __pyx_k_ROLLBACK_TO_SAVEPOINT_s, sizeof(__pyx_k_ROLLBACK_TO_SAVEPOINT_s), 0, 0, 1, 0},
  {&__pyx_n_s_Row, __pyx_k_Row, sizeof(__pyx_k_Row), 0, 0, 1, 1},
  {&__pyx_kp_s_SAVEPOINT_s, __pyx_k_SAVEPOINT_s, sizeof(__pyx_k_SAVEPOINT_s), 0, 0, 1, 0},
  {&__pyx_n_s_SCOPE_CTE, __pyx_k_SCOPE_CTE, sizeof(__pyx_k_SCOPE_CTE), 0, 0, 1, 1},
  {&__pyx_n_s_SCOPE_NORMAL, __pyx_k_SCOPE_NORMAL, sizeof(__pyx_k_SCOPE_NORMAL), 0, 0, 1, 1},
  {&__pyx_n_s_SCOPE_SOURCE, __pyx_k_SCOPE_SOURCE, sizeof(__pyx_k_SCOPE_SOURCE), 0, 0, 1, 1},
  {&__pyx_n_s_SCOPE_VALUES, __pyx_k_SCOPE_VALUES, sizeof(__pyx_k_SCOPE_VALUES), 0, 0, 1, 1},
  {&__pyx_kp_s_SELECT, __pyx_k_SELECT, sizeof(__pyx_k_SELECT), 0, 0, 1, 0},
  {&__pyx_kp_s_SELECT_DISTINCT, __pyx_k_SELECT_DISTINCT, sizeof(__pyx_k_SELECT_DISTINCT), 0, 0, 1, 0},
  {&__pyx_kp_s_SELECT_name_FROM_sqlite_master_W, __pyx_k_SELECT_name_FROM_sqlite_master_W, sizeof(__pyx_k_SELECT_name_FROM_sqlite_master_W), 0, 0, 1, 0},
  {&__pyx_kp_s_SELECT_name_sql_FROM_sqlite_mast, __pyx_k_SELECT_name_sql_FROM_sqlite_mast, sizeof(__pyx_k_SELECT_name_sql_FROM_sqlite_mast), 0, 0, 1, 0},
  {&__pyx_kp_s_SET, __pyx_k_SET, sizeof(__pyx_k_SET), 0, 0, 1, 0},
  {&__pyx_n_s_SQL, __pyx_k_SQL, sizeof(__pyx_k_SQL), 0, 0, 1, 1},
  {&__pyx_n_s_SQLITE_DATETIME_FORMATS, __pyx_k_SQLITE_DATETIME_FORMATS, sizeof(__pyx_k_SQLITE_DATETIME_FORMATS), 0, 0, 1, 1},
  {&__pyx_n_s_SQLITE_DATE_FORMATS, __pyx_k_SQLITE_DATE_FORMATS, sizeof(__pyx_k_SQLITE_DATE_FORMATS), 0, 0, 1, 1},
  {&__pyx_n_s_SQLITE_TIME_FORMATS, __pyx_k_SQLITE_TIME_FORMATS, sizeof(__pyx_k_SQLITE_TIME_FORMATS), 0, 0, 1, 1},
  {&__pyx_n_s_SQL___init, __pyx_k_SQL___init, sizeof(__pyx_k_SQL___init), 0, 0, 1, 1},
  {&__pyx_n_s_SQL___sql, __pyx_k_SQL___sql, sizeof(__pyx_k_SQL___sql), 0, 0, 1, 1},
  {&__pyx_n_s_Select, __pyx_k_Select, sizeof(__pyx_k_Select), 0, 0, 1, 1},
  {&__pyx_n_s_SelectBase, __pyx_k_SelectBase, sizeof(__pyx_k_SelectBase), 0, 0, 1, 1},
  {&__pyx_n_s_SelectBase___add, __pyx_k_SelectBase___add, sizeof(__pyx_k_SelectBase___add), 0, 0, 1, 1},
  {&__pyx_n_s_SelectBase___and, __pyx_k_SelectBase___and, sizeof(__pyx_k_SelectBase___and), 0, 0, 1, 1},
  {&__pyx_n_s_SelectBase___or, __pyx_k_SelectBase___or, sizeof(__pyx_k_SelectBase___or), 0, 0, 1, 1},
  {&__pyx_n_s_SelectBase___sub, __pyx_k_SelectBase___sub, sizeof(__pyx_k_SelectBase___sub), 0, 0, 1, 1},
  {&__pyx_n_s_SelectBase_cte, __pyx_k_SelectBase_cte, sizeof(__pyx_k_SelectBase_cte), 0, 0, 1, 1},
  {&__pyx_n_s_Select___init, __pyx_k_Select___init, sizeof(__pyx_k_Select___init), 0, 0, 1, 1},
  {&__pyx_n_s_Select___sql, __pyx_k_Select___sql, sizeof(__pyx_k_Select___sql), 0, 0, 1, 1},
  {&__pyx_n_s_Select_dicts, __pyx_k_Select_dicts, sizeof(__pyx_k_Select_dicts), 0, 0, 1, 1},
  {&__pyx_n_s_Select_distinct, __pyx_k_Select_distinct, sizeof(__pyx_k_Select_distinct), 0, 0, 1, 1},
  {&__pyx_n_s_Select_execute, __pyx_k_Select_execute, sizeof(__pyx_k_Select_execute), 0, 0, 1, 1},
  {&__pyx_n_s_Select_group_by, __pyx_k_Select_group_by, sizeof(__pyx_k_Select_group_by), 0, 0, 1, 1},
  {&__pyx_n_s_Select_group_by_extend, __pyx_k_Select_group_by_extend, sizeof(__pyx_k_Select_group_by_extend), 0, 0, 1, 1},
  {&__pyx_n_s_Select_having, __pyx_k_Select_having, sizeof(__pyx_k_Select_having), 0, 0, 1, 1},
  {&__pyx_n_s_Select_join, __pyx_k_Select_join, sizeof(__pyx_k_Select_join), 0, 0, 1, 1},
  {&__pyx_n_s_Select_objects, __pyx_k_Select_objects, sizeof(__pyx_k_Select_objects), 0, 0, 1, 1},
  {&__pyx_n_s_Select_select, __pyx_k_Select_select, sizeof(__pyx_k_Select_select), 0, 0, 1, 1},
  {&__pyx_n_s_Select_where, __pyx_k_Select_where, sizeof(__pyx_k_Select_where), 0, 0, 1, 1},
  {&__pyx_n_s_Source, __pyx_k_Source, sizeof(__pyx_k_Source), 0, 0, 1, 1},
  {&__pyx_n_s_Source___init, __pyx_k_Source___init, sizeof(__pyx_k_Source___init), 0, 0, 1, 1},
  {&__pyx_n_s_Source_alias, __pyx_k_Source_alias, sizeof(__pyx_k_Source_alias), 0, 0, 1, 1},
  {&__pyx_n_s_Source_apply_alias, __pyx_k_Source_apply_alias, sizeof(__pyx_k_Source_apply_alias), 0, 0, 1, 1},
  {&__pyx_n_s_Source_join, __pyx_k_Source_join, sizeof(__pyx_k_Source_join), 0, 0, 1, 1},
  {&__pyx_n_s_Source_left_outer_join, __pyx_k_Source_left_outer_join, sizeof(__pyx_k_Source_left_outer_join), 0, 0, 1, 1},
  {&__pyx_n_s_Source_select, __pyx_k_Source_select, sizeof(__pyx_k_Source_select), 0, 0, 1, 1},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s_TIME, __pyx_k_TIME, sizeof(__pyx_k_TIME), 0, 0, 1, 1},
  {&__pyx_n_s_Table, __pyx_k_Table, sizeof(__pyx_k_Table), 0, 0, 1, 1},
  {&__pyx_n_s_TableFunction, __pyx_k_TableFunction, sizeof(__pyx_k_TableFunction), 0, 0, 1, 1},
  {&__pyx_n_s_TableFunction_get_table_columns, __pyx_k_TableFunction_get_table_columns, sizeof(__pyx_k_TableFunction_get_table_columns), 0, 0, 1, 1},
  {&__pyx_n_s_TableFunction_initialize, __pyx_k_TableFunction_initialize, sizeof(__pyx_k_TableFunction_initialize), 0, 0, 1, 1},
  {&__pyx_n_s_TableFunction_iterate, __pyx_k_TableFunction_iterate, sizeof(__pyx_k_TableFunction_iterate), 0, 0, 1, 1},
  {&__pyx_n_s_TableFunction_register, __pyx_k_TableFunction_register, sizeof(__pyx_k_TableFunction_register), 0, 0, 1, 1},
  {&__pyx_n_s_Table___init, __pyx_k_Table___init, sizeof(__pyx_k_Table___init), 0, 0, 1, 1},
  {&__pyx_n_s_Table___sql, __pyx_k_Table___sql, sizeof(__pyx_k_Table___sql), 0, 0, 1, 1},
  {&__pyx_n_s_Table_clone, __pyx_k_Table_clone, sizeof(__pyx_k_Table_clone), 0, 0, 1, 1},
  {&__pyx_n_s_Table_delete, __pyx_k_Table_delete, sizeof(__pyx_k_Table_delete), 0, 0, 1, 1},
  {&__pyx_n_s_Table_insert, __pyx_k_Table_insert, sizeof(__pyx_k_Table_insert), 0, 0, 1, 1},
  {&__pyx_n_s_Table_select, __pyx_k_Table_select, sizeof(__pyx_k_Table_select), 0, 0, 1, 1},
  {&__pyx_n_s_Table_update, __pyx_k_Table_update, sizeof(__pyx_k_Table_update), 0, 0, 1, 1},
  {&__pyx_kp_s_Thread_local_storage_for_connec, __pyx_k_Thread_local_storage_for_connec, sizeof(__pyx_k_Thread_local_storage_for_connec), 0, 0, 1, 0},
  {&__pyx_n_s_UNION, __pyx_k_UNION, sizeof(__pyx_k_UNION), 0, 0, 1, 1},
  {&__pyx_kp_s_UNION_ALL, __pyx_k_UNION_ALL, sizeof(__pyx_k_UNION_ALL), 0, 0, 1, 0},
  {&__pyx_n_s_UPDATE, __pyx_k_UPDATE, sizeof(__pyx_k_UPDATE), 0, 0, 1, 1},
  {&__pyx_kp_s_UPDATE_2, __pyx_k_UPDATE_2, sizeof(__pyx_k_UPDATE_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Unsupported_type_s, __pyx_k_Unsupported_type_s, sizeof(__pyx_k_Unsupported_type_s), 0, 0, 1, 0},
  {&__pyx_n_s_Update, __pyx_k_Update, sizeof(__pyx_k_Update), 0, 0, 1, 1},
  {&__pyx_n_s_Update___init, __pyx_k_Update___init, sizeof(__pyx_k_Update___init), 0, 0, 1, 1},
  {&__pyx_n_s_Update___sql, __pyx_k_Update___sql, sizeof(__pyx_k_Update___sql), 0, 0, 1, 1},
  {&__pyx_n_s_Update_execute, __pyx_k_Update_execute, sizeof(__pyx_k_Update_execute), 0, 0, 1, 1},
  {&__pyx_n_s_Update_on_conflict, __pyx_k_Update_on_conflict, sizeof(__pyx_k_Update_on_conflict), 0, 0, 1, 1},
  {&__pyx_n_s_Update_where, __pyx_k_Update_where, sizeof(__pyx_k_Update_where), 0, 0, 1, 1},
  {&__pyx_kp_s_VALUES, __pyx_k_VALUES, sizeof(__pyx_k_VALUES), 0, 0, 1, 0},
  {&__pyx_n_s_Value, __pyx_k_Value, sizeof(__pyx_k_Value), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_Value___init, __pyx_k_Value___init, sizeof(__pyx_k_Value___init), 0, 0, 1, 1},
  {&__pyx_n_s_Value___sql, __pyx_k_Value___sql, sizeof(__pyx_k_Value___sql), 0, 0, 1, 1},
  {&__pyx_kp_s_WHERE, __pyx_k_WHERE, sizeof(__pyx_k_WHERE), 0, 0, 1, 0},
  {&__pyx_kp_s_WITH, __pyx_k_WITH, sizeof(__pyx_k_WITH), 0, 0, 1, 0},
  {&__pyx_kp_s_WITH_RECURSIVE, __pyx_k_WITH_RECURSIVE, sizeof(__pyx_k_WITH_RECURSIVE), 0, 0, 1, 0},
  {&__pyx_n_s_WriteQuery, __pyx_k_WriteQuery, sizeof(__pyx_k_WriteQuery), 0, 0, 1, 1},
  {&__pyx_n_s_WriteQuery___init, __pyx_k_WriteQuery___init, sizeof(__pyx_k_WriteQuery___init), 0, 0, 1, 1},
  {&__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_s__194, __pyx_k__194, sizeof(__pyx_k__194), 0, 0, 1, 0},
  {&__pyx_kp_s__196, __pyx_k__196, sizeof(__pyx_k__196), 0, 0, 1, 0},
  {&__pyx_kp_s__198, __pyx_k__198, sizeof(__pyx_k__198), 0, 0, 1, 0},
  {&__pyx_kp_s__200, __pyx_k__200, sizeof(__pyx_k__200), 0, 0, 1, 0},
  {&__pyx_kp_s__202, __pyx_k__202, sizeof(__pyx_k__202), 0, 0, 1, 0},
  {&__pyx_kp_s__204, __pyx_k__204, sizeof(__pyx_k__204), 0, 0, 1, 0},
  {&__pyx_kp_s__206, __pyx_k__206, sizeof(__pyx_k__206), 0, 0, 1, 0},
  {&__pyx_kp_s__208, __pyx_k__208, sizeof(__pyx_k__208), 0, 0, 1, 0},
  {&__pyx_kp_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 0},
  {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0},
  {&__pyx_kp_s__52, __pyx_k__52, sizeof(__pyx_k__52), 0, 0, 1, 0},
  {&__pyx_kp_s__53, __pyx_k__53, sizeof(__pyx_k__53), 0, 0, 1, 0},
  {&__pyx_kp_s__57, __pyx_k__57, sizeof(__pyx_k__57), 0, 0, 1, 0},
  {&__pyx_kp_s__59, __pyx_k__59, sizeof(__pyx_k__59), 0, 0, 1, 0},
  {&__pyx_kp_s__60, __pyx_k__60, sizeof(__pyx_k__60), 0, 0, 1, 0},
  {&__pyx_kp_s__63, __pyx_k__63, sizeof(__pyx_k__63), 0, 0, 1, 0},
  {&__pyx_kp_s__64, __pyx_k__64, sizeof(__pyx_k__64), 0, 0, 1, 0},
  {&__pyx_kp_s__71, __pyx_k__71, sizeof(__pyx_k__71), 0, 0, 1, 0},
  {&__pyx_n_s_accum, __pyx_k_accum, sizeof(__pyx_k_accum), 0, 0, 1, 1},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_aggregate_locals_decorator, __pyx_k_aggregate_locals_decorator, sizeof(__pyx_k_aggregate_locals_decorator), 0, 0, 1, 1},
  {&__pyx_n_s_aggregate_name, __pyx_k_aggregate_name, sizeof(__pyx_k_aggregate_name), 0, 0, 1, 1},
  {&__pyx_n_s_alias, __pyx_k_alias, sizeof(__pyx_k_alias), 0, 0, 1, 1},
  {&__pyx_n_s_alias_2, __pyx_k_alias_2, sizeof(__pyx_k_alias_2), 0, 0, 1, 1},
  {&__pyx_n_s_all_values, __pyx_k_all_values, sizeof(__pyx_k_all_values), 0, 0, 1, 1},
  {&__pyx_n_s_and, __pyx_k_and, sizeof(__pyx_k_and), 0, 0, 1, 1},
  {&__pyx_n_s_and_2, __pyx_k_and_2, sizeof(__pyx_k_and_2), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_apply_alias, __pyx_k_apply_alias, sizeof(__pyx_k_apply_alias), 0, 0, 1, 1},
  {&__pyx_n_s_apply_ordering, __pyx_k_apply_ordering, sizeof(__pyx_k_apply_ordering), 0, 0, 1, 1},
  {&__pyx_n_s_arg, __pyx_k_arg, sizeof(__pyx_k_arg), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_arguments, __pyx_k_arguments, sizeof(__pyx_k_arguments), 0, 0, 1, 1},
  {&__pyx_n_s_as_dict, __pyx_k_as_dict, sizeof(__pyx_k_as_dict), 0, 0, 1, 1},
  {&__pyx_n_s_as_object, __pyx_k_as_object, sizeof(__pyx_k_as_object), 0, 0, 1, 1},
  {&__pyx_n_s_asc, __pyx_k_asc, sizeof(__pyx_k_asc), 0, 0, 1, 1},
  {&__pyx_n_s_atomic, __pyx_k_atomic, sizeof(__pyx_k_atomic), 0, 0, 1, 1},
  {&__pyx_n_s_attr, __pyx_k_attr, sizeof(__pyx_k_attr), 0, 0, 1, 1},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_n_s_begin, __pyx_k_begin, sizeof(__pyx_k_begin), 0, 0, 1, 1},
  {&__pyx_n_s_begin_2, __pyx_k_begin_2, sizeof(__pyx_k_begin_2), 0, 0, 1, 1},
  {&__pyx_n_s_between, __pyx_k_between, sizeof(__pyx_k_between), 0, 0, 1, 1},
  {&__pyx_n_s_bind_values, __pyx_k_bind_values, sizeof(__pyx_k_bind_values), 0, 0, 1, 1},
  {&__pyx_n_s_bkey, __pyx_k_bkey, sizeof(__pyx_k_bkey), 0, 0, 1, 1},
  {&__pyx_n_s_bm25, __pyx_k_bm25, sizeof(__pyx_k_bm25), 0, 0, 1, 1},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_n_s_cache_hit, __pyx_k_cache_hit, sizeof(__pyx_k_cache_hit), 0, 0, 1, 1},
  {&__pyx_n_s_cache_miss, __pyx_k_cache_miss, sizeof(__pyx_k_cache_miss), 0, 0, 1, 1},
  {&__pyx_n_s_cache_size, __pyx_k_cache_size, sizeof(__pyx_k_cache_size), 0, 0, 1, 1},
  {&__pyx_n_s_cache_used, __pyx_k_cache_used, sizeof(__pyx_k_cache_used), 0, 0, 1, 1},
  {&__pyx_n_s_cache_used_shared, __pyx_k_cache_used_shared, sizeof(__pyx_k_cache_used_shared), 0, 0, 1, 1},
  {&__pyx_n_s_cache_write, __pyx_k_cache_write, sizeof(__pyx_k_cache_write), 0, 0, 1, 1},
  {&__pyx_n_s_call___locals_inner, __pyx_k_call___locals_inner, sizeof(__pyx_k_call___locals_inner), 0, 0, 1, 1},
  {&__pyx_n_s_cast, __pyx_k_cast, sizeof(__pyx_k_cast), 0, 0, 1, 1},
  {&__pyx_n_s_cfunc_to_py, __pyx_k_cfunc_to_py, sizeof(__pyx_k_cfunc_to_py), 0, 0, 1, 1},
  {&__pyx_n_s_chain, __pyx_k_chain, sizeof(__pyx_k_chain), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_clone, __pyx_k_clone, sizeof(__pyx_k_clone), 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_cls, __pyx_k_cls, sizeof(__pyx_k_cls), 0, 0, 1, 1},
  {&__pyx_n_s_collate, __pyx_k_collate, sizeof(__pyx_k_collate), 0, 0, 1, 1},
  {&__pyx_n_s_collation, __pyx_k_collation, sizeof(__pyx_k_collation), 0, 0, 1, 1},
  {&__pyx_n_s_collation_locals_decorator, __pyx_k_collation_locals_decorator, sizeof(__pyx_k_collation_locals_decorator), 0, 0, 1, 1},
  {&__pyx_n_s_collation_name, __pyx_k_collation_name, sizeof(__pyx_k_collation_name), 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_column_index, __pyx_k_column_index, sizeof(__pyx_k_column_index), 0, 0, 1, 1},
  {&__pyx_n_s_columns, __pyx_k_columns, sizeof(__pyx_k_columns), 0, 0, 1, 1},
  {&__pyx_n_s_columns_2, __pyx_k_columns_2, sizeof(__pyx_k_columns_2), 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_constraint, __pyx_k_constraint, sizeof(__pyx_k_constraint), 0, 0, 1, 1},
  {&__pyx_n_s_contextlib, __pyx_k_contextlib, sizeof(__pyx_k_contextlib), 0, 0, 1, 1},
  {&__pyx_n_s_contextmanager, __pyx_k_contextmanager, sizeof(__pyx_k_contextmanager), 0, 0, 1, 1},
  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
  {&__pyx_n_s_create_aggregate, __pyx_k_create_aggregate, sizeof(__pyx_k_create_aggregate), 0, 0, 1, 1},
  {&__pyx_n_s_create_aggregate_2, __pyx_k_create_aggregate_2, sizeof(__pyx_k_create_aggregate_2), 0, 0, 1, 1},
  {&__pyx_n_s_create_collation, __pyx_k_create_collation, sizeof(__pyx_k_create_collation), 0, 0, 1, 1},
  {&__pyx_n_s_cte, __pyx_k_cte, sizeof(__pyx_k_cte), 0, 0, 1, 1},
  {&__pyx_n_s_cte_list, __pyx_k_cte_list, sizeof(__pyx_k_cte_list), 0, 0, 1, 1},
  {&__pyx_n_s_cte_list_2, __pyx_k_cte_list_2, sizeof(__pyx_k_cte_list_2), 0, 0, 1, 1},
  {&__pyx_n_s_ctx, __pyx_k_ctx, sizeof(__pyx_k_ctx), 0, 0, 1, 1},
  {&__pyx_n_s_current, __pyx_k_current, sizeof(__pyx_k_current), 0, 0, 1, 1},
  {&__pyx_n_s_cursor, __pyx_k_cursor, sizeof(__pyx_k_cursor), 0, 0, 1, 1},
  {&__pyx_n_s_cursor_2, __pyx_k_cursor_2, sizeof(__pyx_k_cursor_2), 0, 0, 1, 1},
  {&__pyx_n_s_cursor_wrapper, __pyx_k_cursor_wrapper, sizeof(__pyx_k_cursor_wrapper), 0, 0, 1, 1},
  {&__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_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
  {&__pyx_n_s_db, __pyx_k_db, sizeof(__pyx_k_db), 0, 0, 1, 1},
  {&__pyx_n_s_dbstatus, __pyx_k_dbstatus, sizeof(__pyx_k_dbstatus), 0, 0, 1, 1},
  {&__pyx_n_s_dbstatus___locals_getter, __pyx_k_dbstatus___locals_getter, sizeof(__pyx_k_dbstatus___locals_getter), 0, 0, 1, 1},
  {&__pyx_n_s_decimal, __pyx_k_decimal, sizeof(__pyx_k_decimal), 0, 0, 1, 1},
  {&__pyx_n_s_decorator, __pyx_k_decorator, sizeof(__pyx_k_decorator), 0, 0, 1, 1},
  {&__pyx_n_s_delete, __pyx_k_delete, sizeof(__pyx_k_delete), 0, 0, 1, 1},
  {&__pyx_n_s_desc, __pyx_k_desc, sizeof(__pyx_k_desc), 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_detect_types, __pyx_k_detect_types, sizeof(__pyx_k_detect_types), 0, 0, 1, 1},
  {&__pyx_n_s_deterministic, __pyx_k_deterministic, sizeof(__pyx_k_deterministic), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_dicts, __pyx_k_dicts, sizeof(__pyx_k_dicts), 0, 0, 1, 1},
  {&__pyx_n_s_dicts_2, __pyx_k_dicts_2, sizeof(__pyx_k_dicts_2), 0, 0, 1, 1},
  {&__pyx_n_s_direction, __pyx_k_direction, sizeof(__pyx_k_direction), 0, 0, 1, 1},
  {&__pyx_n_s_distinct, __pyx_k_distinct, sizeof(__pyx_k_distinct), 0, 0, 1, 1},
  {&__pyx_n_s_distinct_2, __pyx_k_distinct_2, sizeof(__pyx_k_distinct_2), 0, 0, 1, 1},
  {&__pyx_n_s_div, __pyx_k_div, sizeof(__pyx_k_div), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_e, __pyx_k_e, sizeof(__pyx_k_e), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
  {&__pyx_n_s_entity, __pyx_k_entity, sizeof(__pyx_k_entity), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_eq, __pyx_k_eq, sizeof(__pyx_k_eq), 0, 0, 1, 1},
  {&__pyx_n_s_exc_tb, __pyx_k_exc_tb, sizeof(__pyx_k_exc_tb), 0, 0, 1, 1},
  {&__pyx_n_s_exc_type, __pyx_k_exc_type, sizeof(__pyx_k_exc_type), 0, 0, 1, 1},
  {&__pyx_n_s_exc_val, __pyx_k_exc_val, sizeof(__pyx_k_exc_val), 0, 0, 1, 1},
  {&__pyx_n_s_execute, __pyx_k_execute, sizeof(__pyx_k_execute), 0, 0, 1, 1},
  {&__pyx_n_s_execute_2, __pyx_k_execute_2, sizeof(__pyx_k_execute_2), 0, 0, 1, 1},
  {&__pyx_n_s_execute_sql, __pyx_k_execute_sql, sizeof(__pyx_k_execute_sql), 0, 0, 1, 1},
  {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
  {&__pyx_n_s_expressions, __pyx_k_expressions, sizeof(__pyx_k_expressions), 0, 0, 1, 1},
  {&__pyx_n_s_fetchall, __pyx_k_fetchall, sizeof(__pyx_k_fetchall), 0, 0, 1, 1},
  {&__pyx_n_s_fetchone, __pyx_k_fetchone, sizeof(__pyx_k_fetchone), 0, 0, 1, 1},
  {&__pyx_n_s_fill_cache, __pyx_k_fill_cache, sizeof(__pyx_k_fill_cache), 0, 0, 1, 1},
  {&__pyx_n_s_filter, __pyx_k_filter, sizeof(__pyx_k_filter), 0, 0, 1, 1},
  {&__pyx_n_s_filters, __pyx_k_filters, sizeof(__pyx_k_filters), 0, 0, 1, 1},
  {&__pyx_n_s_flag, __pyx_k_flag, sizeof(__pyx_k_flag), 0, 0, 1, 1},
  {&__pyx_n_s_flat, __pyx_k_flat, sizeof(__pyx_k_flat), 0, 0, 1, 1},
  {&__pyx_n_s_fn, __pyx_k_fn, sizeof(__pyx_k_fn), 0, 0, 1, 1},
  {&__pyx_n_s_fn_name, __pyx_k_fn_name, sizeof(__pyx_k_fn_name), 0, 0, 1, 1},
  {&__pyx_n_s_foreign_keys, __pyx_k_foreign_keys, sizeof(__pyx_k_foreign_keys), 0, 0, 1, 1},
  {&__pyx_n_s_format_date, __pyx_k_format_date, sizeof(__pyx_k_format_date), 0, 0, 1, 1},
  {&__pyx_n_s_format_datetime, __pyx_k_format_datetime, sizeof(__pyx_k_format_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_format_time, __pyx_k_format_time, sizeof(__pyx_k_format_time), 0, 0, 1, 1},
  {&__pyx_n_s_from, __pyx_k_from, sizeof(__pyx_k_from), 0, 0, 1, 1},
  {&__pyx_n_s_from_clause, __pyx_k_from_clause, sizeof(__pyx_k_from_clause), 0, 0, 1, 1},
  {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  {&__pyx_n_s_func_locals_decorator, __pyx_k_func_locals_decorator, sizeof(__pyx_k_func_locals_decorator), 0, 0, 1, 1},
  {&__pyx_n_s_ge, __pyx_k_ge, sizeof(__pyx_k_ge), 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_2, __pyx_k_get_2, sizeof(__pyx_k_get_2), 0, 0, 1, 1},
  {&__pyx_n_s_get_columns, __pyx_k_get_columns, sizeof(__pyx_k_get_columns), 0, 0, 1, 1},
  {&__pyx_n_s_get_foreign_keys, __pyx_k_get_foreign_keys, sizeof(__pyx_k_get_foreign_keys), 0, 0, 1, 1},
  {&__pyx_n_s_get_indexes, __pyx_k_get_indexes, sizeof(__pyx_k_get_indexes), 0, 0, 1, 1},
  {&__pyx_n_s_get_primary_keys, __pyx_k_get_primary_keys, sizeof(__pyx_k_get_primary_keys), 0, 0, 1, 1},
  {&__pyx_n_s_get_table_columns_declaration, __pyx_k_get_table_columns_declaration, sizeof(__pyx_k_get_table_columns_declaration), 0, 0, 1, 1},
  {&__pyx_n_s_get_tables, __pyx_k_get_tables, sizeof(__pyx_k_get_tables), 0, 0, 1, 1},
  {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1},
  {&__pyx_n_s_getter, __pyx_k_getter, sizeof(__pyx_k_getter), 0, 0, 1, 1},
  {&__pyx_n_s_glue, __pyx_k_glue, sizeof(__pyx_k_glue), 0, 0, 1, 1},
  {&__pyx_n_s_group_by, __pyx_k_group_by, sizeof(__pyx_k_group_by), 0, 0, 1, 1},
  {&__pyx_n_s_group_by_2, __pyx_k_group_by_2, sizeof(__pyx_k_group_by_2), 0, 0, 1, 1},
  {&__pyx_n_s_group_by_extend, __pyx_k_group_by_extend, sizeof(__pyx_k_group_by_extend), 0, 0, 1, 1},
  {&__pyx_n_s_gt, __pyx_k_gt, sizeof(__pyx_k_gt), 0, 0, 1, 1},
  {&__pyx_n_s_hash_functions, __pyx_k_hash_functions, sizeof(__pyx_k_hash_functions), 0, 0, 1, 1},
  {&__pyx_n_s_hash_impl, __pyx_k_hash_impl, sizeof(__pyx_k_hash_impl), 0, 0, 1, 1},
  {&__pyx_n_s_hash_md5, __pyx_k_hash_md5, sizeof(__pyx_k_hash_md5), 0, 0, 1, 1},
  {&__pyx_n_s_hash_sha1, __pyx_k_hash_sha1, sizeof(__pyx_k_hash_sha1), 0, 0, 1, 1},
  {&__pyx_n_s_hash_sha256, __pyx_k_hash_sha256, sizeof(__pyx_k_hash_sha256), 0, 0, 1, 1},
  {&__pyx_n_s_hashlib, __pyx_k_hashlib, sizeof(__pyx_k_hashlib), 0, 0, 1, 1},
  {&__pyx_n_s_having, __pyx_k_having, sizeof(__pyx_k_having), 0, 0, 1, 1},
  {&__pyx_n_s_having_2, __pyx_k_having_2, sizeof(__pyx_k_having_2), 0, 0, 1, 1},
  {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1},
  {&__pyx_n_s_hexdigest, __pyx_k_hexdigest, sizeof(__pyx_k_hexdigest), 0, 0, 1, 1},
  {&__pyx_n_s_hi, __pyx_k_hi, sizeof(__pyx_k_hi), 0, 0, 1, 1},
  {&__pyx_n_s_highwater, __pyx_k_highwater, sizeof(__pyx_k_highwater), 0, 0, 1, 1},
  {&__pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_k_home_charles_code_sweepea_sweep, sizeof(__pyx_k_home_charles_code_sweepea_sweep), 0, 0, 1, 0},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_idx, __pyx_k_idx, sizeof(__pyx_k_idx), 0, 0, 1, 1},
  {&__pyx_n_s_impl, __pyx_k_impl, sizeof(__pyx_k_impl), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_in, __pyx_k_in, sizeof(__pyx_k_in), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1},
  {&__pyx_n_s_initialize, __pyx_k_initialize, sizeof(__pyx_k_initialize), 0, 0, 1, 1},
  {&__pyx_n_s_initialize_connection, __pyx_k_initialize_connection, sizeof(__pyx_k_initialize_connection), 0, 0, 1, 1},
  {&__pyx_n_s_inner, __pyx_k_inner, sizeof(__pyx_k_inner), 0, 0, 1, 1},
  {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1},
  {&__pyx_n_s_inv, __pyx_k_inv, sizeof(__pyx_k_inv), 0, 0, 1, 1},
  {&__pyx_n_s_inv_2, __pyx_k_inv_2, sizeof(__pyx_k_inv_2), 0, 0, 1, 1},
  {&__pyx_n_s_invert, __pyx_k_invert, sizeof(__pyx_k_invert), 0, 0, 1, 1},
  {&__pyx_n_s_is_closed, __pyx_k_is_closed, sizeof(__pyx_k_is_closed), 0, 0, 1, 1},
  {&__pyx_n_s_is_distinct, __pyx_k_is_distinct, sizeof(__pyx_k_is_distinct), 0, 0, 1, 1},
  {&__pyx_n_s_is_flat, __pyx_k_is_flat, sizeof(__pyx_k_is_flat), 0, 0, 1, 1},
  {&__pyx_n_s_is_flat_2, __pyx_k_is_flat_2, sizeof(__pyx_k_is_flat_2), 0, 0, 1, 1},
  {&__pyx_n_s_is_null, __pyx_k_is_null, sizeof(__pyx_k_is_null), 0, 0, 1, 1},
  {&__pyx_n_s_is_subquery, __pyx_k_is_subquery, sizeof(__pyx_k_is_subquery), 0, 0, 1, 1},
  {&__pyx_n_s_isolation_level, __pyx_k_isolation_level, sizeof(__pyx_k_isolation_level), 0, 0, 1, 1},
  {&__pyx_n_s_item, __pyx_k_item, sizeof(__pyx_k_item), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_iterate, __pyx_k_iterate, sizeof(__pyx_k_iterate), 0, 0, 1, 1},
  {&__pyx_n_s_iterator, __pyx_k_iterator, sizeof(__pyx_k_iterator), 0, 0, 1, 1},
  {&__pyx_n_s_itertools, __pyx_k_itertools, sizeof(__pyx_k_itertools), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_join_type, __pyx_k_join_type, sizeof(__pyx_k_join_type), 0, 0, 1, 1},
  {&__pyx_n_s_join_type_2, __pyx_k_join_type_2, sizeof(__pyx_k_join_type_2), 0, 0, 1, 1},
  {&__pyx_n_s_journal_mode, __pyx_k_journal_mode, sizeof(__pyx_k_journal_mode), 0, 0, 1, 1},
  {&__pyx_n_s_journal_size_limit, __pyx_k_journal_size_limit, sizeof(__pyx_k_journal_size_limit), 0, 0, 1, 1},
  {&__pyx_n_s_k1, __pyx_k_k1, sizeof(__pyx_k_k1), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_klass, __pyx_k_klass, sizeof(__pyx_k_klass), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_le, __pyx_k_le, sizeof(__pyx_k_le), 0, 0, 1, 1},
  {&__pyx_n_s_left_outer_join, __pyx_k_left_outer_join, sizeof(__pyx_k_left_outer_join), 0, 0, 1, 1},
  {&__pyx_n_s_lhs, __pyx_k_lhs, sizeof(__pyx_k_lhs), 0, 0, 1, 1},
  {&__pyx_n_s_lhs_2, __pyx_k_lhs_2, sizeof(__pyx_k_lhs_2), 0, 0, 1, 1},
  {&__pyx_n_s_limit, __pyx_k_limit, sizeof(__pyx_k_limit), 0, 0, 1, 1},
  {&__pyx_n_s_limit_2, __pyx_k_limit_2, sizeof(__pyx_k_limit_2), 0, 0, 1, 1},
  {&__pyx_n_s_literal, __pyx_k_literal, sizeof(__pyx_k_literal), 0, 0, 1, 1},
  {&__pyx_n_s_lo, __pyx_k_lo, sizeof(__pyx_k_lo), 0, 0, 1, 1},
  {&__pyx_n_s_local, __pyx_k_local, sizeof(__pyx_k_local), 0, 0, 1, 1},
  {&__pyx_n_s_lock, __pyx_k_lock, sizeof(__pyx_k_lock), 0, 0, 1, 1},
  {&__pyx_n_s_lock_type, __pyx_k_lock_type, sizeof(__pyx_k_lock_type), 0, 0, 1, 1},
  {&__pyx_n_s_lookaside_hit, __pyx_k_lookaside_hit, sizeof(__pyx_k_lookaside_hit), 0, 0, 1, 1},
  {&__pyx_n_s_lookaside_miss, __pyx_k_lookaside_miss, sizeof(__pyx_k_lookaside_miss), 0, 0, 1, 1},
  {&__pyx_n_s_lookaside_miss_full, __pyx_k_lookaside_miss_full, sizeof(__pyx_k_lookaside_miss_full), 0, 0, 1, 1},
  {&__pyx_n_s_lookaside_used, __pyx_k_lookaside_used, sizeof(__pyx_k_lookaside_used), 0, 0, 1, 1},
  {&__pyx_n_s_lshift, __pyx_k_lshift, sizeof(__pyx_k_lshift), 0, 0, 1, 1},
  {&__pyx_n_s_lt, __pyx_k_lt, sizeof(__pyx_k_lt), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_make_hash, __pyx_k_make_hash, sizeof(__pyx_k_make_hash), 0, 0, 1, 1},
  {&__pyx_n_s_make_hash_locals_inner, __pyx_k_make_hash_locals_inner, sizeof(__pyx_k_make_hash_locals_inner), 0, 0, 1, 1},
  {&__pyx_n_s_malloc_count, __pyx_k_malloc_count, sizeof(__pyx_k_malloc_count), 0, 0, 1, 1},
  {&__pyx_n_s_malloc_size, __pyx_k_malloc_size, sizeof(__pyx_k_malloc_size), 0, 0, 1, 1},
  {&__pyx_n_s_md5, __pyx_k_md5, sizeof(__pyx_k_md5), 0, 0, 1, 1},
  {&__pyx_n_s_memory_used, __pyx_k_memory_used, sizeof(__pyx_k_memory_used), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
  {&__pyx_n_s_mmap_size, __pyx_k_mmap_size, sizeof(__pyx_k_mmap_size), 0, 0, 1, 1},
  {&__pyx_n_s_mod, __pyx_k_mod, sizeof(__pyx_k_mod), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_mul, __pyx_k_mul, sizeof(__pyx_k_mul), 0, 0, 1, 1},
  {&__pyx_n_s_multi, __pyx_k_multi, sizeof(__pyx_k_multi), 0, 0, 1, 1},
  {&__pyx_n_s_multi_insert, __pyx_k_multi_insert, sizeof(__pyx_k_multi_insert), 0, 0, 1, 1},
  {&__pyx_n_s_murmurhash, __pyx_k_murmurhash, sizeof(__pyx_k_murmurhash), 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_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_namedtuple, __pyx_k_namedtuple, sizeof(__pyx_k_namedtuple), 0, 0, 1, 1},
  {&__pyx_n_s_ncols, __pyx_k_ncols, sizeof(__pyx_k_ncols), 0, 0, 1, 1},
  {&__pyx_n_s_ne, __pyx_k_ne, sizeof(__pyx_k_ne), 0, 0, 1, 1},
  {&__pyx_n_s_neg, __pyx_k_neg, sizeof(__pyx_k_neg), 0, 0, 1, 1},
  {&__pyx_n_s_nested_cte_list, __pyx_k_nested_cte_list, sizeof(__pyx_k_nested_cte_list), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1},
  {&__pyx_n_s_not_in, __pyx_k_not_in, sizeof(__pyx_k_not_in), 0, 0, 1, 1},
  {&__pyx_n_s_nparams, __pyx_k_nparams, sizeof(__pyx_k_nparams), 0, 0, 1, 1},
  {&__pyx_n_s_nseed, __pyx_k_nseed, sizeof(__pyx_k_nseed), 0, 0, 1, 1},
  {&__pyx_n_s_nulls, __pyx_k_nulls, sizeof(__pyx_k_nulls), 0, 0, 1, 1},
  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_objects, __pyx_k_objects, sizeof(__pyx_k_objects), 0, 0, 1, 1},
  {&__pyx_n_s_objects_2, __pyx_k_objects_2, sizeof(__pyx_k_objects_2), 0, 0, 1, 1},
  {&__pyx_n_s_offset, __pyx_k_offset, sizeof(__pyx_k_offset), 0, 0, 1, 1},
  {&__pyx_n_s_offset_2, __pyx_k_offset_2, sizeof(__pyx_k_offset_2), 0, 0, 1, 1},
  {&__pyx_n_s_on, __pyx_k_on, sizeof(__pyx_k_on), 0, 0, 1, 1},
  {&__pyx_n_s_on_2, __pyx_k_on_2, sizeof(__pyx_k_on_2), 0, 0, 1, 1},
  {&__pyx_n_s_on_conflict, __pyx_k_on_conflict, sizeof(__pyx_k_on_conflict), 0, 0, 1, 1},
  {&__pyx_n_s_on_conflict_2, __pyx_k_on_conflict_2, sizeof(__pyx_k_on_conflict_2), 0, 0, 1, 1},
  {&__pyx_n_s_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 0, 1, 1},
  {&__pyx_n_s_operator, __pyx_k_operator, sizeof(__pyx_k_operator), 0, 0, 1, 1},
  {&__pyx_n_s_or, __pyx_k_or, sizeof(__pyx_k_or), 0, 0, 1, 1},
  {&__pyx_n_s_order_by, __pyx_k_order_by, sizeof(__pyx_k_order_by), 0, 0, 1, 1},
  {&__pyx_n_s_order_by_2, __pyx_k_order_by_2, sizeof(__pyx_k_order_by_2), 0, 0, 1, 1},
  {&__pyx_n_s_order_by_extend, __pyx_k_order_by_extend, sizeof(__pyx_k_order_by_extend), 0, 0, 1, 1},
  {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
  {&__pyx_n_s_page, __pyx_k_page, sizeof(__pyx_k_page), 0, 0, 1, 1},
  {&__pyx_n_s_page_size, __pyx_k_page_size, sizeof(__pyx_k_page_size), 0, 0, 1, 1},
  {&__pyx_n_s_pagecache_overflow, __pyx_k_pagecache_overflow, sizeof(__pyx_k_pagecache_overflow), 0, 0, 1, 1},
  {&__pyx_n_s_pagecache_size, __pyx_k_pagecache_size, sizeof(__pyx_k_pagecache_size), 0, 0, 1, 1},
  {&__pyx_n_s_pagecache_used, __pyx_k_pagecache_used, sizeof(__pyx_k_pagecache_used), 0, 0, 1, 1},
  {&__pyx_n_s_paginate, __pyx_k_paginate, sizeof(__pyx_k_paginate), 0, 0, 1, 1},
  {&__pyx_n_s_param, __pyx_k_param, sizeof(__pyx_k_param), 0, 0, 1, 1},
  {&__pyx_n_s_params, __pyx_k_params, sizeof(__pyx_k_params), 0, 0, 1, 1},
  {&__pyx_n_s_parentheses, __pyx_k_parentheses, sizeof(__pyx_k_parentheses), 0, 0, 1, 1},
  {&__pyx_n_s_parse, __pyx_k_parse, sizeof(__pyx_k_parse), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_path_2, __pyx_k_path_2, sizeof(__pyx_k_path_2), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 0, 0, 1, 1},
  {&__pyx_n_s_pow, __pyx_k_pow, sizeof(__pyx_k_pow), 0, 0, 1, 1},
  {&__pyx_n_s_pragma, __pyx_k_pragma, sizeof(__pyx_k_pragma), 0, 0, 1, 1},
  {&__pyx_n_s_pragma_2, __pyx_k_pragma_2, sizeof(__pyx_k_pragma_2), 0, 0, 1, 1},
  {&__pyx_n_s_pragma___locals___get, __pyx_k_pragma___locals___get, sizeof(__pyx_k_pragma___locals___get), 0, 0, 1, 1},
  {&__pyx_n_s_pragma___locals___set, __pyx_k_pragma___locals___set, sizeof(__pyx_k_pragma___locals___set), 0, 0, 1, 1},
  {&__pyx_n_s_pragmas, __pyx_k_pragmas, sizeof(__pyx_k_pragmas), 0, 0, 1, 1},
  {&__pyx_n_s_predicate, __pyx_k_predicate, sizeof(__pyx_k_predicate), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_property, __pyx_k_property, sizeof(__pyx_k_property), 0, 0, 1, 1},
  {&__pyx_n_s_pysqlite, __pyx_k_pysqlite, sizeof(__pyx_k_pysqlite), 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_n_s_query_2, __pyx_k_query_2, sizeof(__pyx_k_query_2), 0, 0, 1, 1},
  {&__pyx_n_s_query_insert, __pyx_k_query_insert, sizeof(__pyx_k_query_insert), 0, 0, 1, 1},
  {&__pyx_n_s_quoted, __pyx_k_quoted, sizeof(__pyx_k_quoted), 0, 0, 1, 1},
  {&__pyx_n_s_radd, __pyx_k_radd, sizeof(__pyx_k_radd), 0, 0, 1, 1},
  {&__pyx_n_s_rand, __pyx_k_rand, sizeof(__pyx_k_rand), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_rank, __pyx_k_rank, sizeof(__pyx_k_rank), 0, 0, 1, 1},
  {&__pyx_n_s_rank_functions, __pyx_k_rank_functions, sizeof(__pyx_k_rank_functions), 0, 0, 1, 1},
  {&__pyx_n_s_raw_match_info, __pyx_k_raw_match_info, sizeof(__pyx_k_raw_match_info), 0, 0, 1, 1},
  {&__pyx_n_s_rc, __pyx_k_rc, sizeof(__pyx_k_rc), 0, 0, 1, 1},
  {&__pyx_n_s_rdiv, __pyx_k_rdiv, sizeof(__pyx_k_rdiv), 0, 0, 1, 1},
  {&__pyx_n_s_re, __pyx_k_re, sizeof(__pyx_k_re), 0, 0, 1, 1},
  {&__pyx_n_s_read_uncommitted, __pyx_k_read_uncommitted, sizeof(__pyx_k_read_uncommitted), 0, 0, 1, 1},
  {&__pyx_n_s_recursive, __pyx_k_recursive, sizeof(__pyx_k_recursive), 0, 0, 1, 1},
  {&__pyx_n_s_recursive_2, __pyx_k_recursive_2, sizeof(__pyx_k_recursive_2), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_regex, __pyx_k_regex, sizeof(__pyx_k_regex), 0, 0, 1, 1},
  {&__pyx_n_s_regex_function, __pyx_k_regex_function, sizeof(__pyx_k_regex_function), 0, 0, 1, 1},
  {&__pyx_n_s_regexp, __pyx_k_regexp, sizeof(__pyx_k_regexp), 0, 0, 1, 1},
  {&__pyx_n_s_register, __pyx_k_register, sizeof(__pyx_k_register), 0, 0, 1, 1},
  {&__pyx_n_s_register_adapter, __pyx_k_register_adapter, sizeof(__pyx_k_register_adapter), 0, 0, 1, 1},
  {&__pyx_n_s_register_converter, __pyx_k_register_converter, sizeof(__pyx_k_register_converter), 0, 0, 1, 1},
  {&__pyx_n_s_return_current, __pyx_k_return_current, sizeof(__pyx_k_return_current), 0, 0, 1, 1},
  {&__pyx_n_s_return_highwater, __pyx_k_return_highwater, sizeof(__pyx_k_return_highwater), 0, 0, 1, 1},
  {&__pyx_n_s_rhs, __pyx_k_rhs, sizeof(__pyx_k_rhs), 0, 0, 1, 1},
  {&__pyx_n_s_rhs_2, __pyx_k_rhs_2, sizeof(__pyx_k_rhs_2), 0, 0, 1, 1},
  {&__pyx_n_s_rmul, __pyx_k_rmul, sizeof(__pyx_k_rmul), 0, 0, 1, 1},
  {&__pyx_n_s_rollback, __pyx_k_rollback, sizeof(__pyx_k_rollback), 0, 0, 1, 1},
  {&__pyx_n_s_ror, __pyx_k_ror, sizeof(__pyx_k_ror), 0, 0, 1, 1},
  {&__pyx_n_s_row, __pyx_k_row, sizeof(__pyx_k_row), 0, 0, 1, 1},
  {&__pyx_n_s_rows_iter, __pyx_k_rows_iter, sizeof(__pyx_k_rows_iter), 0, 0, 1, 1},
  {&__pyx_n_s_rshift, __pyx_k_rshift, sizeof(__pyx_k_rshift), 0, 0, 1, 1},
  {&__pyx_n_s_rsub, __pyx_k_rsub, sizeof(__pyx_k_rsub), 0, 0, 1, 1},
  {&__pyx_kp_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 0},
  {&__pyx_n_s_s_2, __pyx_k_s_2, sizeof(__pyx_k_s_2), 0, 0, 1, 1},
  {&__pyx_kp_s_s_3, __pyx_k_s_3, sizeof(__pyx_k_s_3), 0, 0, 1, 0},
  {&__pyx_kp_s_s_4, __pyx_k_s_4, sizeof(__pyx_k_s_4), 0, 0, 1, 0},
  {&__pyx_kp_s_s_5, __pyx_k_s_5, sizeof(__pyx_k_s_5), 0, 0, 1, 0},
  {&__pyx_kp_s_s_6, __pyx_k_s_6, sizeof(__pyx_k_s_6), 0, 0, 1, 0},
  {&__pyx_kp_s_s_HIDDEN, __pyx_k_s_HIDDEN, sizeof(__pyx_k_s_HIDDEN), 0, 0, 1, 0},
  {&__pyx_kp_s_s_JOIN, __pyx_k_s_JOIN, sizeof(__pyx_k_s_JOIN), 0, 0, 1, 0},
  {&__pyx_kp_s_s_s, __pyx_k_s_s, sizeof(__pyx_k_s_s), 0, 0, 1, 0},
  {&__pyx_kp_s_s_specifies_columns_explicitly, __pyx_k_s_specifies_columns_explicitly, sizeof(__pyx_k_s_specifies_columns_explicitly), 0, 0, 1, 0},
  {&__pyx_n_s_savepoint, __pyx_k_savepoint, sizeof(__pyx_k_savepoint), 0, 0, 1, 1},
  {&__pyx_n_s_schema, __pyx_k_schema, sizeof(__pyx_k_schema), 0, 0, 1, 1},
  {&__pyx_n_s_schema_2, __pyx_k_schema_2, sizeof(__pyx_k_schema_2), 0, 0, 1, 1},
  {&__pyx_n_s_schema_used, __pyx_k_schema_used, sizeof(__pyx_k_schema_used), 0, 0, 1, 1},
  {&__pyx_n_s_scope, __pyx_k_scope, sizeof(__pyx_k_scope), 0, 0, 1, 1},
  {&__pyx_n_s_scope_context, __pyx_k_scope_context, sizeof(__pyx_k_scope_context), 0, 0, 1, 1},
  {&__pyx_n_s_scope_context___locals_inner, __pyx_k_scope_context___locals_inner, sizeof(__pyx_k_scope_context___locals_inner), 0, 0, 1, 1},
  {&__pyx_n_s_scope_cte, __pyx_k_scope_cte, sizeof(__pyx_k_scope_cte), 0, 0, 1, 1},
  {&__pyx_n_s_scope_normal, __pyx_k_scope_normal, sizeof(__pyx_k_scope_normal), 0, 0, 1, 1},
  {&__pyx_n_s_scope_source, __pyx_k_scope_source, sizeof(__pyx_k_scope_source), 0, 0, 1, 1},
  {&__pyx_n_s_scope_values, __pyx_k_scope_values, sizeof(__pyx_k_scope_values), 0, 0, 1, 1},
  {&__pyx_n_s_scratch_overflow, __pyx_k_scratch_overflow, sizeof(__pyx_k_scratch_overflow), 0, 0, 1, 1},
  {&__pyx_n_s_scratch_size, __pyx_k_scratch_size, sizeof(__pyx_k_scratch_size), 0, 0, 1, 1},
  {&__pyx_n_s_scratch_used, __pyx_k_scratch_used, sizeof(__pyx_k_scratch_used), 0, 0, 1, 1},
  {&__pyx_n_s_search, __pyx_k_search, sizeof(__pyx_k_search), 0, 0, 1, 1},
  {&__pyx_n_s_seed, __pyx_k_seed, sizeof(__pyx_k_seed), 0, 0, 1, 1},
  {&__pyx_n_s_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 0, 1, 1},
  {&__pyx_n_s_selection, __pyx_k_selection, sizeof(__pyx_k_selection), 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_sentinel, __pyx_k_sentinel, sizeof(__pyx_k_sentinel), 0, 0, 1, 1},
  {&__pyx_n_s_set, __pyx_k_set, sizeof(__pyx_k_set), 0, 0, 1, 1},
  {&__pyx_n_s_set_commit_hook, __pyx_k_set_commit_hook, sizeof(__pyx_k_set_commit_hook), 0, 0, 1, 1},
  {&__pyx_n_s_set_rollback_hook, __pyx_k_set_rollback_hook, sizeof(__pyx_k_set_rollback_hook), 0, 0, 1, 1},
  {&__pyx_n_s_set_update_hook, __pyx_k_set_update_hook, sizeof(__pyx_k_set_update_hook), 0, 0, 1, 1},
  {&__pyx_n_s_setdefault, __pyx_k_setdefault, sizeof(__pyx_k_setdefault), 0, 0, 1, 1},
  {&__pyx_n_s_sha1, __pyx_k_sha1, sizeof(__pyx_k_sha1), 0, 0, 1, 1},
  {&__pyx_n_s_sha256, __pyx_k_sha256, sizeof(__pyx_k_sha256), 0, 0, 1, 1},
  {&__pyx_n_s_sid, __pyx_k_sid, sizeof(__pyx_k_sid), 0, 0, 1, 1},
  {&__pyx_n_s_simple_insert, __pyx_k_simple_insert, sizeof(__pyx_k_simple_insert), 0, 0, 1, 1},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_sql, __pyx_k_sql, sizeof(__pyx_k_sql), 0, 0, 1, 1},
  {&__pyx_n_s_sql_2, __pyx_k_sql_2, sizeof(__pyx_k_sql_2), 0, 0, 1, 1},
  {&__pyx_n_s_sqlite3, __pyx_k_sqlite3, sizeof(__pyx_k_sqlite3), 0, 0, 1, 1},
  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {&__pyx_n_s_statement_used, __pyx_k_statement_used, sizeof(__pyx_k_statement_used), 0, 0, 1, 1},
  {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
  {&__pyx_n_s_status, __pyx_k_status, sizeof(__pyx_k_status), 0, 0, 1, 1},
  {&__pyx_n_s_status___locals_getter, __pyx_k_status___locals_getter, sizeof(__pyx_k_status___locals_getter), 0, 0, 1, 1},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_strptime, __pyx_k_strptime, sizeof(__pyx_k_strptime), 0, 0, 1, 1},
  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
  {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1},
  {&__pyx_n_s_subquery, __pyx_k_subquery, sizeof(__pyx_k_subquery), 0, 0, 1, 1},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_sweepea, __pyx_k_sweepea, sizeof(__pyx_k_sweepea), 0, 0, 1, 1},
  {&__pyx_n_s_synchronous, __pyx_k_synchronous, sizeof(__pyx_k_synchronous), 0, 0, 1, 1},
  {&__pyx_n_s_table, __pyx_k_table, sizeof(__pyx_k_table), 0, 0, 1, 1},
  {&__pyx_n_s_table_function, __pyx_k_table_function, sizeof(__pyx_k_table_function), 0, 0, 1, 1},
  {&__pyx_n_s_table_function_locals_decorator, __pyx_k_table_function_locals_decorator, sizeof(__pyx_k_table_function_locals_decorator), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_threading, __pyx_k_threading, sizeof(__pyx_k_threading), 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_timeout, __pyx_k_timeout, sizeof(__pyx_k_timeout), 0, 0, 1, 1},
  {&__pyx_n_s_transaction, __pyx_k_transaction, sizeof(__pyx_k_transaction), 0, 0, 1, 1},
  {&__pyx_n_s_transactions, __pyx_k_transactions, sizeof(__pyx_k_transactions), 0, 0, 1, 1},
  {&__pyx_n_s_transform, __pyx_k_transform, sizeof(__pyx_k_transform), 0, 0, 1, 1},
  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_kp_s_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 0, 1, 0},
  {&__pyx_n_s_uuid, __pyx_k_uuid, sizeof(__pyx_k_uuid), 0, 0, 1, 1},
  {&__pyx_n_s_uuid4, __pyx_k_uuid4, sizeof(__pyx_k_uuid4), 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_wal_autocheckpoint, __pyx_k_wal_autocheckpoint, sizeof(__pyx_k_wal_autocheckpoint), 0, 0, 1, 1},
  {&__pyx_n_s_where, __pyx_k_where, sizeof(__pyx_k_where), 0, 0, 1, 1},
  {&__pyx_n_s_where_2, __pyx_k_where_2, sizeof(__pyx_k_where_2), 0, 0, 1, 1},
  {&__pyx_n_s_with, __pyx_k_with, sizeof(__pyx_k_with), 0, 0, 1, 1},
  {&__pyx_n_s_wrap, __pyx_k_wrap, sizeof(__pyx_k_wrap), 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, 546, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(0, 2067, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 327, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 412, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 460, __pyx_L1_error)
  __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 576, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 588, __pyx_L1_error)
  __pyx_builtin_property = __Pyx_GetBuiltinName(__pyx_n_s_property); if (!__pyx_builtin_property) __PYX_ERR(0, 978, __pyx_L1_error)
  __pyx_builtin_Exception = __Pyx_GetBuiltinName(__pyx_n_s_Exception); if (!__pyx_builtin_Exception) __PYX_ERR(0, 977, __pyx_L1_error)
  __pyx_builtin_super = __Pyx_GetBuiltinName(__pyx_n_s_super); if (!__pyx_builtin_super) __PYX_ERR(0, 1136, __pyx_L1_error)
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 2056, __pyx_L1_error)
  __pyx_builtin_filter = __Pyx_GetBuiltinName(__pyx_n_s_filter); if (!__pyx_builtin_filter) __PYX_ERR(0, 2363, __pyx_L1_error)
  __pyx_builtin_reduce = __Pyx_GetBuiltinName(__pyx_n_s_reduce); if (!__pyx_builtin_reduce) __PYX_ERR(0, 2577, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "sweepea.pyx":408
 *         return SQLITE_ERROR
 *     elif idxStr:
 *         params = str(idxStr).split(',')             # <<<<<<<<<<<<<<
 *     else:
 *         params = []
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "sweepea.pyx":435
 *     pCur.stopped = False
 *     try:
 *         row_data = table_func.iterate(0)             # <<<<<<<<<<<<<<
 *     except StopIteration:
 *         pCur.stopped = True
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "sweepea.pyx":588
 *             if isinstance(column, tuple):
 *                 if len(column) != 2:
 *                     raise ValueError('Column must be either a string or a '             # <<<<<<<<<<<<<<
 *                                      '2-tuple of name, type')
 *                 accum.append('%s %s' % column)
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_Column_must_be_either_a_string_o); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "sweepea.pyx":762
 * 
 *     if isinstance(key, unicode):
 *         bkey = <bytes>key.encode('utf-8')             # <<<<<<<<<<<<<<
 *     else:
 *         bkey = <bytes>key
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_utf_8); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "sweepea.pyx":777
 * 
 * def make_hash(hash_impl):
 *     def inner(*items):             # <<<<<<<<<<<<<<
 *         state = hash_impl()
 *         for item in items:
 */
  __pyx_tuple__7 = PyTuple_Pack(3, __pyx_n_s_items, __pyx_n_s_state, __pyx_n_s_item); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);
  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(0, 0, 3, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_inner, 777, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 777, __pyx_L1_error)

  /* "sweepea.pyx":956
 *     def __call__(self, fn):
 *         def inner(*args, **kwargs):
 *             with self:             # <<<<<<<<<<<<<<
 *                 return fn(*args, **kwargs)
 *         return inner
 */
  __pyx_tuple__9 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);
  __pyx_tuple__10 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "sweepea.pyx":955
 * cdef class _callable_context_manager(object):
 *     def __call__(self, fn):
 *         def inner(*args, **kwargs):             # <<<<<<<<<<<<<<
 *             with self:
 *                 return fn(*args, **kwargs)
 */
  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);
  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(0, 0, 2, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_inner, 955, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 955, __pyx_L1_error)

  /* "sweepea.pyx":968
 *     Database object.
 *     """
 *     def getter(self):             # <<<<<<<<<<<<<<
 *         cdef int current, highwater
 *         cdef int rc = sqlite3_status(flag, &current, &highwater, 0)
 */
  __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_current, __pyx_n_s_highwater, __pyx_n_s_rc); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);
  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_getter, 968, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 968, __pyx_L1_error)

  /* "sweepea.pyx":987
 *     to the current connection.
 *     """
 *     def getter(Database self):             # <<<<<<<<<<<<<<
 *         cdef:
 *             int current, hi
 */
  __pyx_tuple__15 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_current, __pyx_n_s_hi, __pyx_n_s_conn, __pyx_n_s_rc); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);
  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_getter, 987, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 987, __pyx_L1_error)

  /* "sweepea.pyx":1010
 *     getter and setter.
 *     """
 *     def __get__(self):             # <<<<<<<<<<<<<<
 *         return self.pragma(name)
 *     def __set__(self, value):
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 1010, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);
  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_get, 1010, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 1010, __pyx_L1_error)

  /* "sweepea.pyx":1012
 *     def __get__(self):
 *         return self.pragma(name)
 *     def __set__(self, value):             # <<<<<<<<<<<<<<
 *         return self.pragma(name, value)
 *     return property(__get__, __set__)
 */
  __pyx_tuple__19 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);
  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_set, 1012, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 1012, __pyx_L1_error)

  /* "sweepea.pyx":1023
 *     """
 *     if not conn.initialized:
 *         raise InterfaceError('Connection not initialized.')             # <<<<<<<<<<<<<<
 *     if not conn.db:
 *         raise InterfaceError('Cannot operate on closed database.')
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Connection_not_initialized); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 1023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "sweepea.pyx":1025
 *         raise InterfaceError('Connection not initialized.')
 *     if not conn.db:
 *         raise InterfaceError('Cannot operate on closed database.')             # <<<<<<<<<<<<<<
 *     return 1
 * 
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Cannot_operate_on_closed_databas); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "sweepea.pyx":1196
 *         # Register built-in custom functions.
 *         if rank_functions:
 *             self.func('rank')(rank)             # <<<<<<<<<<<<<<
 *             self.func('bm25')(bm25)
 *         if regex_function:
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_n_s_rank); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 1196, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "sweepea.pyx":1197
 *         if rank_functions:
 *             self.func('rank')(rank)
 *             self.func('bm25')(bm25)             # <<<<<<<<<<<<<<
 *         if regex_function:
 *             self.func('regexp')(regexp)
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_bm25); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 1197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "sweepea.pyx":1199
 *             self.func('bm25')(bm25)
 *         if regex_function:
 *             self.func('regexp')(regexp)             # <<<<<<<<<<<<<<
 *         if hash_functions:
 *             self.func('murmurhash')(murmurhash)
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_n_s_regexp); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 1199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "sweepea.pyx":1201
 *             self.func('regexp')(regexp)
 *         if hash_functions:
 *             self.func('murmurhash')(murmurhash)             # <<<<<<<<<<<<<<
 *             self.func('md5')(hash_md5)
 *             self.func('sha1')(hash_sha1)
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_n_s_murmurhash); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 1201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "sweepea.pyx":1202
 *         if hash_functions:
 *             self.func('murmurhash')(murmurhash)
 *             self.func('md5')(hash_md5)             # <<<<<<<<<<<<<<
 *             self.func('sha1')(hash_sha1)
 *             self.func('sha256')(hash_sha256)
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_n_s_md5); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1202, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "sweepea.pyx":1203
 *             self.func('murmurhash')(murmurhash)
 *             self.func('md5')(hash_md5)
 *             self.func('sha1')(hash_sha1)             # <<<<<<<<<<<<<<
 *             self.func('sha256')(hash_sha256)
 * 
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_n_s_sha1); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(0, 1203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "sweepea.pyx":1204
 *             self.func('md5')(hash_md5)
 *             self.func('sha1')(hash_sha1)
 *             self.func('sha256')(hash_sha256)             # <<<<<<<<<<<<<<
 * 
 *     def init(self, database, **connect_kwargs):
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_n_s_sha256); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "sweepea.pyx":1241
 *         with self._lock:
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')             # <<<<<<<<<<<<<<
 *             if not self._local.closed:
 *                 raise InterfaceError('Connection already open in this thread.')
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Database_has_not_been_initialize); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 1241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "sweepea.pyx":1243
 *                 raise InterfaceError('Database has not been initialized.')
 *             if not self._local.closed:
 *                 raise InterfaceError('Connection already open in this thread.')             # <<<<<<<<<<<<<<
 *             conn = self._local.conn = pysqlite.connect(self.database,
 *                                                        **self.connect_kwargs)
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Connection_already_open_in_this); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "sweepea.pyx":1239
 *         the connection was already opened.
 *         """
 *         with self._lock:             # <<<<<<<<<<<<<<
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')
 */
  __pyx_tuple__33 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 1239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "sweepea.pyx":1260
 *         with self._lock:
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')             # <<<<<<<<<<<<<<
 *             if not self._local.closed:
 *                 self._local.conn.close()
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Database_has_not_been_initialize); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 1260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "sweepea.pyx":1258
 *         the database is already closed, this is a no-op.
 *         """
 *         with self._lock:             # <<<<<<<<<<<<<<
 *             if self.deferred:
 *                 raise InterfaceError('Database has not been initialized.')
 */
  __pyx_tuple__35 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);
  __pyx_tuple__36 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 1258, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "sweepea.pyx":1324
 *                     return avg(self.vals)
 *         """
 *         def decorator(klass):             # <<<<<<<<<<<<<<
 *             aggregate_name = name or klass.__name__
 *             self._aggregates[aggregate_name] = klass
 */
  __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_klass, __pyx_n_s_aggregate_name); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);
  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_decorator, 1324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 1324, __pyx_L1_error)

  /* "sweepea.pyx":1350
 *                 return cmp(l1, l2)
 *         """
 *         def decorator(fn):             # <<<<<<<<<<<<<<
 *             collation_name = name or fn.__name__
 *             self._collations[collation_name] = fn
 */
  __pyx_tuple__39 = PyTuple_Pack(2, __pyx_n_s_fn, __pyx_n_s_collation_name); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);
  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_decorator, 1350, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 1350, __pyx_L1_error)

  /* "sweepea.pyx":1377
 * 
 *         if rc != SQLITE_OK:
 *             raise ValueError('Error calling sqlite3_create_function.')             # <<<<<<<<<<<<<<
 *         else:
 *             self._function_map[fn] = name
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Error_calling_sqlite3_create_fun); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 1377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "sweepea.pyx":1391
 *                 return hashlib.md5(s).hexdigest()
 *         """
 *         def decorator(fn):             # <<<<<<<<<<<<<<
 *             fn_name = name or fn.__name__
 *             self._functions[fn_name] = (fn, n, deterministic)
 */
  __pyx_tuple__42 = PyTuple_Pack(2, __pyx_n_s_fn, __pyx_n_s_fn_name); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);
  __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_decorator, 1391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) __PYX_ERR(0, 1391, __pyx_L1_error)

  /* "sweepea.pyx":1420
 *                 return (ret,)
 *         """
 *         def decorator(klass):             # <<<<<<<<<<<<<<
 *             if name is not None:
 *                 klass.name = name
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_n_s_klass); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);
  __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_decorator, 1420, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) __PYX_ERR(0, 1420, __pyx_L1_error)

  /* "sweepea.pyx":1697
 *         """
 *         cursor = self.execute_sql('SELECT name FROM sqlite_master WHERE '
 *                                   'type = ? ORDER BY name;', ('table',))             # <<<<<<<<<<<<<<
 *         return [row[0] for row in cursor.fetchall()]
 * 
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_table); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 1697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "sweepea.pyx":1938
 *     @contextmanager
 *     def inner(self, **kwargs):
 *         with self(scope=scope, **kwargs):             # <<<<<<<<<<<<<<
 *             yield self
 *     return inner
 */
  __pyx_tuple__49 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 1938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "sweepea.pyx":1937
 * def __scope_context__(int scope):
 *     @contextmanager
 *     def inner(self, **kwargs):             # <<<<<<<<<<<<<<
 *         with self(scope=scope, **kwargs):
 *             yield self
 */
  __pyx_tuple__50 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 1937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);
  __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_inner, 1937, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) __PYX_ERR(0, 1937, __pyx_L1_error)

  /* "sweepea.pyx":2056
 *     def __get__(self, instance, instance_type):
 *         if instance is not None:
 *             raise AttributeError('%s specifies columns explicitly and does not'             # <<<<<<<<<<<<<<
 *                                  ' support dynamic column lookups.')
 *         return self
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_s_specifies_columns_explicitly); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 2056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "sweepea.pyx":2069
 *     @staticmethod
 *     def copy(method):
 *         def inner(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *             clone = self.clone()
 *             method(clone, *args, **kwargs)
 */
  __pyx_tuple__55 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_clone); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 2069, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);
  __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_inner, 2069, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__56)) __PYX_ERR(0, 2069, __pyx_L1_error)

  /* "sweepea.pyx":2184
 *                 ctx.literal(' ').sql(EnclosedList(self._columns))
 *             ctx.literal(' AS (')
 *             with ctx.scope_normal():             # <<<<<<<<<<<<<<
 *                 ctx.sql(self._query)
 *             ctx.literal(')')
 */
  __pyx_tuple__58 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 2184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "sweepea.pyx":2204
 *         return self.asc()
 *     def __e__(op, inv=False):
 *         def inner(self, rhs):             # <<<<<<<<<<<<<<
 *             if inv:
 *                 return Expression(rhs, op, self)
 */
  __pyx_tuple__61 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rhs); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(0, 2204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);
  __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_inner, 2204, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__62)) __PYX_ERR(0, 2204, __pyx_L1_error)

  /* "sweepea.pyx":2270
 *             return ctx.sql(Entity(self.name))
 *         else:
 *             with ctx.scope_normal():             # <<<<<<<<<<<<<<
 *                 return ctx.sql(self.table).literal('.').sql(Entity(self.name))
 * 
 */
  __pyx_tuple__65 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(0, 2270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);
  __pyx_tuple__66 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 2270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "sweepea.pyx":2286
 * 
 *     def __sql__(self, Context ctx):
 *         with ctx(parentheses=not self._is_flat):             # <<<<<<<<<<<<<<
 *             return (ctx
 *                     .sql(self.lhs)
 */
  __pyx_tuple__67 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(0, 2286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);
  __pyx_tuple__68 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 2286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "sweepea.pyx":2396
 * 
 *     def __getattr__(self, attr):
 *         def decorator(*args):             # <<<<<<<<<<<<<<
 *             return Function(attr, args)
 *         return decorator
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_n_s_args); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(0, 2396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);
  __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_decorator, 2396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__70)) __PYX_ERR(0, 2396, __pyx_L1_error)

  /* "sweepea.pyx":2427
 *         if n == 0:
 *             return ctx
 *         with ctx(parentheses=self.parentheses):             # <<<<<<<<<<<<<<
 *             for i in range(n - 1):
 *                 ctx.sql(self.nodes[i])
 */
  __pyx_tuple__72 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 2427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "sweepea.pyx":2496
 *         if self._cte_list:
 *             recursive = any(cte._recursive for cte in self._cte_list)
 *             with ctx.scope_cte():             # <<<<<<<<<<<<<<
 *                 (ctx
 *                  .literal('WITH RECURSIVE ' if recursive else 'WITH ')
 */
  __pyx_tuple__73 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(0, 2496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "sweepea.pyx":2531
 *     def __sql__(self, Context ctx):
 *         with ctx(parentheses=ctx.scope == SCOPE_SOURCE):
 *             with ctx(parentheses=False):             # <<<<<<<<<<<<<<
 *                 ctx.sql(self.lhs)
 *             ctx.literal(' %s ' % self.op)
 */
  __pyx_tuple__74 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 2531, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "sweepea.pyx":2534
 *                 ctx.sql(self.lhs)
 *             ctx.literal(' %s ' % self.op)
 *             with ctx(parentheses=False):             # <<<<<<<<<<<<<<
 *                 ctx.sql(self.rhs)
 *         ctx = self.apply_ordering(ctx)
 */
  __pyx_tuple__75 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(0, 2534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "sweepea.pyx":2530
 * 
 *     def __sql__(self, Context ctx):
 *         with ctx(parentheses=ctx.scope == SCOPE_SOURCE):             # <<<<<<<<<<<<<<
 *             with ctx(parentheses=False):
 *                 ctx.sql(self.lhs)
 */
  __pyx_tuple__76 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 2530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "sweepea.pyx":2569
 *     def join(self, dest, join_type='INNER', on=None):
 *         if not self._from:
 *             raise ValueError('No sources to join on.')             # <<<<<<<<<<<<<<
 *         item = self._from.pop()
 *         self._from.append(Join(item, dest, join_type, on))
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_No_sources_to_join_on); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(0, 2569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "sweepea.pyx":2611
 *         with ctx.scope_normal(parentheses=parentheses, subquery=True):
 *             ctx.literal('SELECT DISTINCT ' if self._distinct else 'SELECT ')
 *             with ctx.scope_source():             # <<<<<<<<<<<<<<
 *                 ctx.sql(CommaList(self._columns))
 * 
 */
  __pyx_tuple__78 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 2611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "sweepea.pyx":2615
 * 
 *             if self._from:
 *                 with ctx.scope_source(parentheses=False):             # <<<<<<<<<<<<<<
 *                     ctx.literal(' FROM ').sql(CommaList(self._from))
 * 
 */
  __pyx_tuple__79 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(0, 2615, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "sweepea.pyx":2609
 *         is_subquery = ctx.subquery
 *         parentheses = is_subquery or (ctx.scope == SCOPE_SOURCE)
 *         with ctx.scope_normal(parentheses=parentheses, subquery=True):             # <<<<<<<<<<<<<<
 *             ctx.literal('SELECT DISTINCT ' if self._distinct else 'SELECT ')
 *             with ctx.scope_source():
 */
  __pyx_tuple__80 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 2609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "sweepea.pyx":2676
 *              .literal(' SET ')
 *              .sql(CommaList([
 *                  List((key, SQL('='), value))             # <<<<<<<<<<<<<<
 *                  for key, value in self.data.items()])))
 * 
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s__59); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(0, 2676, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "sweepea.pyx":2667
 * 
 *     def __sql__(self, Context ctx):
 *         with ctx.scope_values(subquery=True):             # <<<<<<<<<<<<<<
 *             ctx.literal('UPDATE ')
 *             if self._on_conflict:
 */
  __pyx_tuple__82 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 2667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);
  __pyx_tuple__83 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(0, 2667, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "sweepea.pyx":2745
 *     def __sql__(self, Context ctx):
 *         super(Insert, self).__sql__(ctx)
 *         with ctx.scope_values():             # <<<<<<<<<<<<<<
 *             ctx.literal('INSERT ')
 *             if self._on_conflict:
 */
  __pyx_tuple__84 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 2745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "sweepea.pyx":2777
 *         super(Delete, self).__sql__(ctx)
 * 
 *         with ctx.scope_values(subquery=True):             # <<<<<<<<<<<<<<
 *             ctx.literal('DELETE FROM ').sql(self.table)
 *             if self._where is not None:
 */
  __pyx_tuple__85 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(0, 2777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);
  __pyx_tuple__86 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 2777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "cfunc.to_py":65
 * @cname("__Pyx_CFunc_object____CursorWrapper____tuple___to_py")
 * cdef object __Pyx_CFunc_object____CursorWrapper____tuple___to_py(object (*f)(CursorWrapper, tuple) ):
 *     def wrap(CursorWrapper cursor_wrapper, tuple row):             # <<<<<<<<<<<<<<
 *         """wrap(cursor_wrapper: 'CursorWrapper', row: tuple)"""
 *         return f(cursor_wrapper, row)
 */
  __pyx_tuple__87 = PyTuple_Pack(2, __pyx_n_s_cursor_wrapper, __pyx_n_s_row); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);
  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__87, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) __PYX_ERR(2, 65, __pyx_L1_error)
  __pyx_tuple__89 = PyTuple_Pack(2, __pyx_n_s_cursor_wrapper, __pyx_n_s_row); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);
  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__89, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) __PYX_ERR(2, 65, __pyx_L1_error)
  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_n_s_raw_match_info); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);
  __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__91, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) __PYX_ERR(2, 65, __pyx_L1_error)
  __pyx_tuple__93 = PyTuple_Pack(4, __pyx_n_s_raw_match_info, __pyx_n_s_column_index, __pyx_n_s_k1, __pyx_n_s_b); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__93, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) __PYX_ERR(2, 65, __pyx_L1_error)
  __pyx_tuple__95 = PyTuple_Pack(2, __pyx_n_s_value, __pyx_n_s_regex); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(2, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);
  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(2, 65, __pyx_L1_error)

  /* "sweepea.pyx":570
 * 
 *     @classmethod
 *     def register(cls, conn):             # <<<<<<<<<<<<<<
 *         cdef _TableFunctionImpl impl = _TableFunctionImpl(cls)
 *         impl.create_module(<pysqlite_Connection *>conn)
 */
  __pyx_tuple__97 = PyTuple_Pack(3, __pyx_n_s_cls, __pyx_n_s_conn, __pyx_n_s_impl); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);
  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_register, 570, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 570, __pyx_L1_error)

  /* "sweepea.pyx":575
 *         cls._ncols = len(cls.columns)
 * 
 *     def initialize(self, **filters):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_tuple__99 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_filters); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_initialize, 575, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 575, __pyx_L1_error)

  /* "sweepea.pyx":578
 *         raise NotImplementedError
 * 
 *     def iterate(self, idx):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_tuple__101 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_idx); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_iterate, 578, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 578, __pyx_L1_error)

  /* "sweepea.pyx":582
 * 
 *     @classmethod
 *     def get_table_columns_declaration(cls):             # <<<<<<<<<<<<<<
 *         cdef list accum = []
 * 
 */
  __pyx_tuple__103 = PyTuple_Pack(4, __pyx_n_s_cls, __pyx_n_s_accum, __pyx_n_s_column, __pyx_n_s_param); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_get_table_columns_declaration, 582, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 582, __pyx_L1_error)

  /* "sweepea.pyx":753
 * 
 * 
 * def murmurhash(key, seed=None):             # <<<<<<<<<<<<<<
 *     if key is None:
 *         return
 */
  __pyx_tuple__105 = PyTuple_Pack(4, __pyx_n_s_key, __pyx_n_s_seed, __pyx_n_s_bkey, __pyx_n_s_nseed); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);
  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_murmurhash, 753, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 753, __pyx_L1_error)

  /* "sweepea.pyx":776
 * 
 * 
 * def make_hash(hash_impl):             # <<<<<<<<<<<<<<
 *     def inner(*items):
 *         state = hash_impl()
 */
  __pyx_tuple__107 = PyTuple_Pack(3, __pyx_n_s_hash_impl, __pyx_n_s_inner, __pyx_n_s_inner); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);
  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_make_hash, 776, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 776, __pyx_L1_error)

  /* "sweepea.pyx":935
 *     return accum
 * 
 * def DictCursorWrapper(cursor):             # <<<<<<<<<<<<<<
 *     return CursorWrapper(cursor, dict_transform)
 * 
 */
  __pyx_tuple__109 = PyTuple_Pack(1, __pyx_n_s_cursor); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_DictCursorWrapper, 935, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 935, __pyx_L1_error)

  /* "sweepea.pyx":963
 * 
 * 
 * def __status__(flag, return_highwater=False):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a sqlite3_status() call for a particular flag as a property of the
 */
  __pyx_tuple__111 = PyTuple_Pack(4, __pyx_n_s_flag, __pyx_n_s_return_highwater, __pyx_n_s_getter, __pyx_n_s_getter); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_status, 963, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 963, __pyx_L1_error)

  /* "sweepea.pyx":981
 * 
 * 
 * def __dbstatus__(flag, return_highwater=False, return_current=False):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a sqlite3_dbstatus() call for a particular flag as a property of the
 */
  __pyx_tuple__113 = PyTuple_Pack(5, __pyx_n_s_flag, __pyx_n_s_return_highwater, __pyx_n_s_return_current, __pyx_n_s_getter, __pyx_n_s_getter); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);
  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_dbstatus, 981, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 981, __pyx_L1_error)

  /* "sweepea.pyx":1005
 * 
 * 
 * def __pragma__(name):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a SQLite PRAGMA operation as a property of the Database, with a
 */
  __pyx_tuple__115 = PyTuple_Pack(5, __pyx_n_s_name, __pyx_n_s_get, __pyx_n_s_get, __pyx_n_s_set, __pyx_n_s_set); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_pragma_2, 1005, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 1005, __pyx_L1_error)

  /* "sweepea.pyx":1135
 *     Thread-local storage for connection state and transaction management.
 *     """
 *     def __init__(self, **kwargs):             # <<<<<<<<<<<<<<
 *         super(ConnectionLocal, self).__init__(**kwargs)
 *         self.closed = True
 */
  __pyx_tuple__117 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);
  __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 1135, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 1135, __pyx_L1_error)

  /* "sweepea.pyx":1774
 * 
 *     # Pragma queries.
 *     cache_size = __pragma__('cache_size')             # <<<<<<<<<<<<<<
 *     foreign_keys = __pragma__('foreign_keys')
 *     journal_mode = __pragma__('journal_mode')
 */
  __pyx_tuple__119 = PyTuple_Pack(1, __pyx_n_s_cache_size); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 1774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);

  /* "sweepea.pyx":1775
 *     # Pragma queries.
 *     cache_size = __pragma__('cache_size')
 *     foreign_keys = __pragma__('foreign_keys')             # <<<<<<<<<<<<<<
 *     journal_mode = __pragma__('journal_mode')
 *     journal_size_limit = __pragma__('journal_size_limit')
 */
  __pyx_tuple__120 = PyTuple_Pack(1, __pyx_n_s_foreign_keys); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);

  /* "sweepea.pyx":1776
 *     cache_size = __pragma__('cache_size')
 *     foreign_keys = __pragma__('foreign_keys')
 *     journal_mode = __pragma__('journal_mode')             # <<<<<<<<<<<<<<
 *     journal_size_limit = __pragma__('journal_size_limit')
 *     mmap_size = __pragma__('mmap_size')
 */
  __pyx_tuple__121 = PyTuple_Pack(1, __pyx_n_s_journal_mode); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);

  /* "sweepea.pyx":1777
 *     foreign_keys = __pragma__('foreign_keys')
 *     journal_mode = __pragma__('journal_mode')
 *     journal_size_limit = __pragma__('journal_size_limit')             # <<<<<<<<<<<<<<
 *     mmap_size = __pragma__('mmap_size')
 *     page_size = __pragma__('page_size')
 */
  __pyx_tuple__122 = PyTuple_Pack(1, __pyx_n_s_journal_size_limit); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(0, 1777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);

  /* "sweepea.pyx":1778
 *     journal_mode = __pragma__('journal_mode')
 *     journal_size_limit = __pragma__('journal_size_limit')
 *     mmap_size = __pragma__('mmap_size')             # <<<<<<<<<<<<<<
 *     page_size = __pragma__('page_size')
 *     read_uncommitted = __pragma__('read_uncommitted')
 */
  __pyx_tuple__123 = PyTuple_Pack(1, __pyx_n_s_mmap_size); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 1778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "sweepea.pyx":1779
 *     journal_size_limit = __pragma__('journal_size_limit')
 *     mmap_size = __pragma__('mmap_size')
 *     page_size = __pragma__('page_size')             # <<<<<<<<<<<<<<
 *     read_uncommitted = __pragma__('read_uncommitted')
 *     synchronous = __pragma__('synchronous')
 */
  __pyx_tuple__124 = PyTuple_Pack(1, __pyx_n_s_page_size); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(0, 1779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "sweepea.pyx":1780
 *     mmap_size = __pragma__('mmap_size')
 *     page_size = __pragma__('page_size')
 *     read_uncommitted = __pragma__('read_uncommitted')             # <<<<<<<<<<<<<<
 *     synchronous = __pragma__('synchronous')
 *     wal_autocheckpoint = __pragma__('wal_autocheckpoint')
 */
  __pyx_tuple__125 = PyTuple_Pack(1, __pyx_n_s_read_uncommitted); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 1780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "sweepea.pyx":1781
 *     page_size = __pragma__('page_size')
 *     read_uncommitted = __pragma__('read_uncommitted')
 *     synchronous = __pragma__('synchronous')             # <<<<<<<<<<<<<<
 *     wal_autocheckpoint = __pragma__('wal_autocheckpoint')
 * 
 */
  __pyx_tuple__126 = PyTuple_Pack(1, __pyx_n_s_synchronous); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(0, 1781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "sweepea.pyx":1782
 *     read_uncommitted = __pragma__('read_uncommitted')
 *     synchronous = __pragma__('synchronous')
 *     wal_autocheckpoint = __pragma__('wal_autocheckpoint')             # <<<<<<<<<<<<<<
 * 
 *     # Status properties.
 */
  __pyx_tuple__127 = PyTuple_Pack(1, __pyx_n_s_wal_autocheckpoint); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 1782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);

  /* "sweepea.pyx":1935
 * 
 * 
 * def __scope_context__(int scope):             # <<<<<<<<<<<<<<
 *     @contextmanager
 *     def inner(self, **kwargs):
 */
  __pyx_tuple__128 = PyTuple_Pack(4, __pyx_n_s_scope, __pyx_n_s_scope, __pyx_n_s_inner, __pyx_n_s_inner); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);
  __pyx_codeobj__129 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__128, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_scope_context, 1935, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__129)) __PYX_ERR(0, 1935, __pyx_L1_error)

  /* "sweepea.pyx":2062
 * 
 * class Node(object):
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         obj = self.__class__.__new__(self.__class__)
 *         obj.__dict__ = self.__dict__.copy()
 */
  __pyx_tuple__130 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_obj); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 2062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);
  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_clone, 2062, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 2062, __pyx_L1_error)

  /* "sweepea.pyx":2068
 * 
 *     @staticmethod
 *     def copy(method):             # <<<<<<<<<<<<<<
 *         def inner(self, *args, **kwargs):
 *             clone = self.clone()
 */
  __pyx_tuple__132 = PyTuple_Pack(3, __pyx_n_s_method, __pyx_n_s_inner, __pyx_n_s_inner); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 2068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_copy, 2068, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 2068, __pyx_L1_error)

  /* "sweepea.pyx":2079
 *     c = _DynamicColumn()
 * 
 *     def __init__(self, alias=None):             # <<<<<<<<<<<<<<
 *         super(Source, self).__init__()
 *         self._alias = alias
 */
  __pyx_tuple__134 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_alias); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(0, 2079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);
  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2079, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(0, 2079, __pyx_L1_error)
  __pyx_tuple__136 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(0, 2079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);

  /* "sweepea.pyx":2084
 * 
 *     @Node.copy
 *     def alias(self, name=None):             # <<<<<<<<<<<<<<
 *         self._alias = name
 * 
 */
  __pyx_tuple__137 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(0, 2084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);
  __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(2, 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_charles_code_sweepea_sweep, __pyx_n_s_alias, 2084, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(0, 2084, __pyx_L1_error)
  __pyx_tuple__139 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(0, 2084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);

  /* "sweepea.pyx":2087
 *         self._alias = name
 * 
 *     def select(self, *selection):             # <<<<<<<<<<<<<<
 *         return Select((self,), selection)
 * 
 */
  __pyx_tuple__140 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_selection); if (unlikely(!__pyx_tuple__140)) __PYX_ERR(0, 2087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__140);
  __Pyx_GIVEREF(__pyx_tuple__140);
  __pyx_codeobj__141 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__140, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_select, 2087, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__141)) __PYX_ERR(0, 2087, __pyx_L1_error)

  /* "sweepea.pyx":2090
 *         return Select((self,), selection)
 * 
 *     def join(self, other, join_type='INNER', on=None):             # <<<<<<<<<<<<<<
 *         return Join(self, other, join_type, on)
 * 
 */
  __pyx_tuple__142 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_join_type, __pyx_n_s_on); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(0, 2090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);
  __pyx_codeobj__143 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__142, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_join, 2090, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__143)) __PYX_ERR(0, 2090, __pyx_L1_error)
  __pyx_tuple__144 = PyTuple_Pack(2, ((PyObject*)__pyx_n_s_INNER), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(0, 2090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);

  /* "sweepea.pyx":2093
 *         return Join(self, other, join_type, on)
 * 
 *     def left_outer_join(self, other, on=None):             # <<<<<<<<<<<<<<
 *         return self.join(other, 'LEFT OUTER', on)
 * 
 */
  __pyx_tuple__145 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_other, __pyx_n_s_on); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(0, 2093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);
  __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_left_outer_join, 2093, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(0, 2093, __pyx_L1_error)
  __pyx_tuple__147 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(0, 2093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);

  /* "sweepea.pyx":2096
 *         return self.join(other, 'LEFT OUTER', on)
 * 
 *     def apply_alias(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if ctx.scope == SCOPE_SOURCE and self._alias:
 *             ctx.literal(' AS ').sql(Entity(self._alias))
 */
  __pyx_tuple__148 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(0, 2096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);
  __pyx_codeobj__149 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__148, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_apply_alias, 2096, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__149)) __PYX_ERR(0, 2096, __pyx_L1_error)

  /* "sweepea.pyx":2103
 * 
 * class Table(Source):
 *     def __init__(self, name, columns=None, schema=None, alias=None):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self._columns = columns
 */
  __pyx_tuple__150 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_columns, __pyx_n_s_schema, __pyx_n_s_alias, __pyx_n_s_column); if (unlikely(!__pyx_tuple__150)) __PYX_ERR(0, 2103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__150);
  __Pyx_GIVEREF(__pyx_tuple__150);
  __pyx_codeobj__151 = (PyObject*)__Pyx_PyCode_New(5, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__150, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2103, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__151)) __PYX_ERR(0, 2103, __pyx_L1_error)
  __pyx_tuple__152 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(0, 2103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);

  /* "sweepea.pyx":2115
 *                 setattr(self, column, Column(self, column))
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         return Table(self.name, self._columns, schema=self._schema,
 *                      alias=self._alias)
 */
  __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(0, 2115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);
  __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_clone, 2115, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(0, 2115, __pyx_L1_error)

  /* "sweepea.pyx":2119
 *                      alias=self._alias)
 * 
 *     def select(self, *selection):             # <<<<<<<<<<<<<<
 *         if not selection and self._columns:
 *             selection = [Column(self, column) for column in self._columns]
 */
  __pyx_tuple__155 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_selection, __pyx_n_s_column); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(0, 2119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);
  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_select, 2119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(0, 2119, __pyx_L1_error)

  /* "sweepea.pyx":2124
 *         return Select((self,), selection)
 * 
 *     def insert(self, data, **kwargs):             # <<<<<<<<<<<<<<
 *         return Insert(self, data, **kwargs)
 * 
 */
  __pyx_tuple__157 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_data, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 2124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);
  __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_insert, 2124, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 2124, __pyx_L1_error)

  /* "sweepea.pyx":2127
 *         return Insert(self, data, **kwargs)
 * 
 *     def update(self, data):             # <<<<<<<<<<<<<<
 *         return Update(self, data)
 * 
 */
  __pyx_tuple__159 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_data); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 2127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);
  __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_update, 2127, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 2127, __pyx_L1_error)

  /* "sweepea.pyx":2130
 *         return Update(self, data)
 * 
 *     def delete(self):             # <<<<<<<<<<<<<<
 *         return Delete(self)
 * 
 */
  __pyx_tuple__161 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(0, 2130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);
  __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_delete, 2130, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(0, 2130, __pyx_L1_error)

  /* "sweepea.pyx":2133
 *         return Delete(self)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if ctx.scope == SCOPE_SOURCE:
 *             ctx.sql(Entity(*self._path))
 */
  __pyx_tuple__163 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(0, 2133, __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_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(0, 2133, __pyx_L1_error)

  /* "sweepea.pyx":2147
 * 
 * class Join(Source):
 *     def __init__(self, lhs, rhs, join_type='INNER', on=None):             # <<<<<<<<<<<<<<
 *         super(Join, self).__init__()
 *         self._lhs = lhs
 */
  __pyx_tuple__165 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_lhs, __pyx_n_s_rhs, __pyx_n_s_join_type, __pyx_n_s_on); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(0, 2147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);
  __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2147, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(0, 2147, __pyx_L1_error)
  __pyx_tuple__167 = PyTuple_Pack(2, ((PyObject*)__pyx_n_s_INNER), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 2147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);

  /* "sweepea.pyx":2154
 *         self._on = on
 * 
 *     def on(self, predicate):             # <<<<<<<<<<<<<<
 *         self._on = predicate
 *         return self
 */
  __pyx_tuple__168 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_predicate); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(0, 2154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);
  __pyx_codeobj__169 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__168, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_on, 2154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__169)) __PYX_ERR(0, 2154, __pyx_L1_error)

  /* "sweepea.pyx":2158
 *         return self
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         (ctx
 *          .sql(self._lhs)
 */
  __pyx_tuple__170 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__170)) __PYX_ERR(0, 2158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__170);
  __Pyx_GIVEREF(__pyx_tuple__170);
  __pyx_codeobj__171 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__170, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2158, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__171)) __PYX_ERR(0, 2158, __pyx_L1_error)

  /* "sweepea.pyx":2169
 * 
 * class CTE(Source):
 *     def __init__(self, name, query, recursive=False, columns=None):             # <<<<<<<<<<<<<<
 *         self._alias = name
 *         self._nested_cte_list = query._cte_list
 */
  __pyx_tuple__172 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_query, __pyx_n_s_recursive, __pyx_n_s_columns); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(0, 2169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__172);
  __Pyx_GIVEREF(__pyx_tuple__172);
  __pyx_codeobj__173 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__172, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__173)) __PYX_ERR(0, 2169, __pyx_L1_error)
  __pyx_tuple__174 = PyTuple_Pack(2, ((PyObject *)Py_False), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(0, 2169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);

  /* "sweepea.pyx":2178
 *         super(CTE, self).__init__(alias=name)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.sql(Entity(self._alias))
 *         if ctx.scope == SCOPE_CTE:
 */
  __pyx_tuple__175 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 2178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);
  __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2178, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(0, 2178, __pyx_L1_error)

  /* "sweepea.pyx":2191
 * 
 * class EntityBase(Node):
 *     def alias(self, name):             # <<<<<<<<<<<<<<
 *         return Alias(self, name)
 *     def __inv__(self):
 */
  __pyx_tuple__177 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 2191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);
  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_alias, 2191, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 2191, __pyx_L1_error)

  /* "sweepea.pyx":2193
 *     def alias(self, name):
 *         return Alias(self, name)
 *     def __inv__(self):             # <<<<<<<<<<<<<<
 *         return Negated(self)
 *     def __eq__(self, other):
 */
  __pyx_tuple__179 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 2193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);
  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_inv_2, 2193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 2193, __pyx_L1_error)

  /* "sweepea.pyx":2195
 *     def __inv__(self):
 *         return Negated(self)
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return Expression(self, '=', other)
 *     def __ne__(self, other):
 */
  __pyx_tuple__181 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(0, 2195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__181);
  __Pyx_GIVEREF(__pyx_tuple__181);
  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_eq, 2195, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(0, 2195, __pyx_L1_error)

  /* "sweepea.pyx":2197
 *     def __eq__(self, other):
 *         return Expression(self, '=', other)
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return Expression(self, '!=', other)
 *     def __neg__(self):
 */
  __pyx_tuple__183 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_other); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 2197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);
  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_ne, 2197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(0, 2197, __pyx_L1_error)

  /* "sweepea.pyx":2199
 *     def __ne__(self, other):
 *         return Expression(self, '!=', other)
 *     def __neg__(self):             # <<<<<<<<<<<<<<
 *         return self.desc()
 *     def __pos__(self):
 */
  __pyx_tuple__185 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(0, 2199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);
  __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_neg, 2199, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(0, 2199, __pyx_L1_error)

  /* "sweepea.pyx":2201
 *     def __neg__(self):
 *         return self.desc()
 *     def __pos__(self):             # <<<<<<<<<<<<<<
 *         return self.asc()
 *     def __e__(op, inv=False):
 */
  __pyx_tuple__187 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 2201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_pos, 2201, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 2201, __pyx_L1_error)

  /* "sweepea.pyx":2203
 *     def __pos__(self):
 *         return self.asc()
 *     def __e__(op, inv=False):             # <<<<<<<<<<<<<<
 *         def inner(self, rhs):
 *             if inv:
 */
  __pyx_tuple__189 = PyTuple_Pack(4, __pyx_n_s_op, __pyx_n_s_inv, __pyx_n_s_inner, __pyx_n_s_inner); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 2203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_e, 2203, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(0, 2203, __pyx_L1_error)
  __pyx_tuple__191 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 2203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);

  /* "sweepea.pyx":2209
 *             return Expression(self, op, rhs)
 *         return inner
 *     __and__ = __e__('AND')             # <<<<<<<<<<<<<<
 *     __or__ = __e__('OR')
 *     __add__ = __e__('+')
 */
  __pyx_tuple__192 = PyTuple_Pack(1, __pyx_n_s_AND); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(0, 2209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);

  /* "sweepea.pyx":2210
 *         return inner
 *     __and__ = __e__('AND')
 *     __or__ = __e__('OR')             # <<<<<<<<<<<<<<
 *     __add__ = __e__('+')
 *     __sub__ = __e__('-')
 */
  __pyx_tuple__193 = PyTuple_Pack(1, __pyx_n_s_OR); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 2210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);

  /* "sweepea.pyx":2211
 *     __and__ = __e__('AND')
 *     __or__ = __e__('OR')
 *     __add__ = __e__('+')             # <<<<<<<<<<<<<<
 *     __sub__ = __e__('-')
 *     __mul__ = __e__('*')
 */
  __pyx_tuple__195 = PyTuple_Pack(1, __pyx_kp_s__194); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 2211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);

  /* "sweepea.pyx":2212
 *     __or__ = __e__('OR')
 *     __add__ = __e__('+')
 *     __sub__ = __e__('-')             # <<<<<<<<<<<<<<
 *     __mul__ = __e__('*')
 *     __div__ = __e__('/')
 */
  __pyx_tuple__197 = PyTuple_Pack(1, __pyx_kp_s__196); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);

  /* "sweepea.pyx":2213
 *     __add__ = __e__('+')
 *     __sub__ = __e__('-')
 *     __mul__ = __e__('*')             # <<<<<<<<<<<<<<
 *     __div__ = __e__('/')
 *     __rand__ = __e__('AND', True)
 */
  __pyx_tuple__199 = PyTuple_Pack(1, __pyx_kp_s__198); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(0, 2213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);

  /* "sweepea.pyx":2214
 *     __sub__ = __e__('-')
 *     __mul__ = __e__('*')
 *     __div__ = __e__('/')             # <<<<<<<<<<<<<<
 *     __rand__ = __e__('AND', True)
 *     __ror__ = __e__('OR', True)
 */
  __pyx_tuple__201 = PyTuple_Pack(1, __pyx_kp_s__200); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);

  /* "sweepea.pyx":2221
 *     __rmul__ = __e__('*', True)
 *     __rdiv__ = __e__('/', True)
 *     __lt__ = __e__('<')             # <<<<<<<<<<<<<<
 *     __gt__ = __e__('>')
 *     __le__ = __e__('<=')
 */
  __pyx_tuple__203 = PyTuple_Pack(1, __pyx_kp_s__202); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(0, 2221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);

  /* "sweepea.pyx":2222
 *     __rdiv__ = __e__('/', True)
 *     __lt__ = __e__('<')
 *     __gt__ = __e__('>')             # <<<<<<<<<<<<<<
 *     __le__ = __e__('<=')
 *     __ge__ = __e__('>=')
 */
  __pyx_tuple__205 = PyTuple_Pack(1, __pyx_kp_s__204); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(0, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);

  /* "sweepea.pyx":2223
 *     __lt__ = __e__('<')
 *     __gt__ = __e__('>')
 *     __le__ = __e__('<=')             # <<<<<<<<<<<<<<
 *     __ge__ = __e__('>=')
 *     __lshift__ = __e__('IN')
 */
  __pyx_tuple__207 = PyTuple_Pack(1, __pyx_kp_s__206); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(0, 2223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__207);
  __Pyx_GIVEREF(__pyx_tuple__207);

  /* "sweepea.pyx":2224
 *     __gt__ = __e__('>')
 *     __le__ = __e__('<=')
 *     __ge__ = __e__('>=')             # <<<<<<<<<<<<<<
 *     __lshift__ = __e__('IN')
 *     __rshift__ = __e__('IS')
 */
  __pyx_tuple__209 = PyTuple_Pack(1, __pyx_kp_s__208); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(0, 2224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__209);
  __Pyx_GIVEREF(__pyx_tuple__209);

  /* "sweepea.pyx":2225
 *     __le__ = __e__('<=')
 *     __ge__ = __e__('>=')
 *     __lshift__ = __e__('IN')             # <<<<<<<<<<<<<<
 *     __rshift__ = __e__('IS')
 *     __mod__ = __e__('LIKE')
 */
  __pyx_tuple__210 = PyTuple_Pack(1, __pyx_n_s_IN); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(0, 2225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);

  /* "sweepea.pyx":2226
 *     __ge__ = __e__('>=')
 *     __lshift__ = __e__('IN')
 *     __rshift__ = __e__('IS')             # <<<<<<<<<<<<<<
 *     __mod__ = __e__('LIKE')
 *     __pow__ = __e__('GLOB')
 */
  __pyx_tuple__211 = PyTuple_Pack(1, __pyx_n_s_IS); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(0, 2226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);

  /* "sweepea.pyx":2227
 *     __lshift__ = __e__('IN')
 *     __rshift__ = __e__('IS')
 *     __mod__ = __e__('LIKE')             # <<<<<<<<<<<<<<
 *     __pow__ = __e__('GLOB')
 *     in_ = __e__('IN')
 */
  __pyx_tuple__212 = PyTuple_Pack(1, __pyx_n_s_LIKE); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(0, 2227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);

  /* "sweepea.pyx":2228
 *     __rshift__ = __e__('IS')
 *     __mod__ = __e__('LIKE')
 *     __pow__ = __e__('GLOB')             # <<<<<<<<<<<<<<
 *     in_ = __e__('IN')
 *     not_in = __e__('NOT IN')
 */
  __pyx_tuple__213 = PyTuple_Pack(1, __pyx_n_s_GLOB); if (unlikely(!__pyx_tuple__213)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__213);
  __Pyx_GIVEREF(__pyx_tuple__213);

  /* "sweepea.pyx":2229
 *     __mod__ = __e__('LIKE')
 *     __pow__ = __e__('GLOB')
 *     in_ = __e__('IN')             # <<<<<<<<<<<<<<
 *     not_in = __e__('NOT IN')
 *     def is_null(self, is_null=True):
 */
  __pyx_tuple__214 = PyTuple_Pack(1, __pyx_n_s_IN); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(0, 2229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);

  /* "sweepea.pyx":2230
 *     __pow__ = __e__('GLOB')
 *     in_ = __e__('IN')
 *     not_in = __e__('NOT IN')             # <<<<<<<<<<<<<<
 *     def is_null(self, is_null=True):
 *         return Expression(self, ('IS' if is_null else 'IS NOT'), None)
 */
  __pyx_tuple__215 = PyTuple_Pack(1, __pyx_kp_s_NOT_IN); if (unlikely(!__pyx_tuple__215)) __PYX_ERR(0, 2230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__215);
  __Pyx_GIVEREF(__pyx_tuple__215);

  /* "sweepea.pyx":2231
 *     in_ = __e__('IN')
 *     not_in = __e__('NOT IN')
 *     def is_null(self, is_null=True):             # <<<<<<<<<<<<<<
 *         return Expression(self, ('IS' if is_null else 'IS NOT'), None)
 *     def between(self, lo, hi):
 */
  __pyx_tuple__216 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_is_null); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__216);
  __Pyx_GIVEREF(__pyx_tuple__216);
  __pyx_codeobj__217 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__216, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_is_null, 2231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __pyx_tuple__218 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__218);
  __Pyx_GIVEREF(__pyx_tuple__218);

  /* "sweepea.pyx":2233
 *     def is_null(self, is_null=True):
 *         return Expression(self, ('IS' if is_null else 'IS NOT'), None)
 *     def between(self, lo, hi):             # <<<<<<<<<<<<<<
 *         return Expression(self, 'BETWEEN', Expression(lo, 'AND', hi, True))
 * 
 */
  __pyx_tuple__219 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_lo, __pyx_n_s_hi); if (unlikely(!__pyx_tuple__219)) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__219);
  __Pyx_GIVEREF(__pyx_tuple__219);
  __pyx_codeobj__220 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__219, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_between, 2233, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__220)) __PYX_ERR(0, 2233, __pyx_L1_error)

  /* "sweepea.pyx":2236
 *         return Expression(self, 'BETWEEN', Expression(lo, 'AND', hi, True))
 * 
 *     def asc(self):             # <<<<<<<<<<<<<<
 *         return Asc(self)
 *     def desc(self):
 */
  __pyx_tuple__221 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__221)) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__221);
  __Pyx_GIVEREF(__pyx_tuple__221);
  __pyx_codeobj__222 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__221, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_asc, 2236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__222)) __PYX_ERR(0, 2236, __pyx_L1_error)

  /* "sweepea.pyx":2238
 *     def asc(self):
 *         return Asc(self)
 *     def desc(self):             # <<<<<<<<<<<<<<
 *         return Desc(self)
 * 
 */
  __pyx_tuple__223 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__223)) __PYX_ERR(0, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__223);
  __Pyx_GIVEREF(__pyx_tuple__223);
  __pyx_codeobj__224 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__223, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_desc, 2238, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__224)) __PYX_ERR(0, 2238, __pyx_L1_error)

  /* "sweepea.pyx":2243
 * 
 * class Value(EntityBase):
 *     def __init__(self, value):             # <<<<<<<<<<<<<<
 *         self.value = value
 *         self.multi = isinstance(self.value, (list, tuple))
 */
  __pyx_tuple__225 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_item); if (unlikely(!__pyx_tuple__225)) __PYX_ERR(0, 2243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__225);
  __Pyx_GIVEREF(__pyx_tuple__225);
  __pyx_codeobj__226 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__225, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__226)) __PYX_ERR(0, 2243, __pyx_L1_error)

  /* "sweepea.pyx":2254
 *                     self.bind_values.append(Value(item))
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self.multi:
 *             return ctx.sql(EnclosedList(self.bind_values))
 */
  __pyx_tuple__227 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__227)) __PYX_ERR(0, 2254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__227);
  __Pyx_GIVEREF(__pyx_tuple__227);
  __pyx_codeobj__228 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__227, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2254, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__228)) __PYX_ERR(0, 2254, __pyx_L1_error)

  /* "sweepea.pyx":2262
 * 
 * class Column(EntityBase):
 *     def __init__(self, table, name):             # <<<<<<<<<<<<<<
 *         self.table = table
 *         self.name = name
 */
  __pyx_tuple__229 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_table, __pyx_n_s_name); if (unlikely(!__pyx_tuple__229)) __PYX_ERR(0, 2262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__229);
  __Pyx_GIVEREF(__pyx_tuple__229);
  __pyx_codeobj__230 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__229, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2262, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__230)) __PYX_ERR(0, 2262, __pyx_L1_error)

  /* "sweepea.pyx":2266
 *         self.name = name
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if ctx.scope == SCOPE_VALUES:
 *             return ctx.sql(Entity(self.name))
 */
  __pyx_tuple__231 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__231)) __PYX_ERR(0, 2266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__231);
  __Pyx_GIVEREF(__pyx_tuple__231);
  __pyx_codeobj__232 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__231, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__232)) __PYX_ERR(0, 2266, __pyx_L1_error)

  /* "sweepea.pyx":2275
 * 
 * class Expression(EntityBase):
 *     def __init__(self, lhs, op, rhs, is_flat=False):             # <<<<<<<<<<<<<<
 *         if not isinstance(lhs, Node):
 *             lhs = Value(lhs)
 */
  __pyx_tuple__233 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_lhs, __pyx_n_s_op, __pyx_n_s_rhs, __pyx_n_s_is_flat); if (unlikely(!__pyx_tuple__233)) __PYX_ERR(0, 2275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__233);
  __Pyx_GIVEREF(__pyx_tuple__233);
  __pyx_codeobj__234 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__233, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2275, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__234)) __PYX_ERR(0, 2275, __pyx_L1_error)
  __pyx_tuple__235 = PyTuple_Pack(1, ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__235)) __PYX_ERR(0, 2275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__235);
  __Pyx_GIVEREF(__pyx_tuple__235);

  /* "sweepea.pyx":2285
 *         self._is_flat = is_flat
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         with ctx(parentheses=not self._is_flat):
 *             return (ctx
 */
  __pyx_tuple__236 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(0, 2285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__236);
  __Pyx_GIVEREF(__pyx_tuple__236);
  __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2285, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(0, 2285, __pyx_L1_error)

  /* "sweepea.pyx":2294
 * 
 * class EntityWrapper(EntityBase):
 *     def __init__(self, entity, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self.entity = entity
 *         super(EntityWrapper, self).__init__(*args, **kwargs)
 */
  __pyx_tuple__238 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_entity, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(0, 2294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__238);
  __Pyx_GIVEREF(__pyx_tuple__238);
  __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__238, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2294, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(0, 2294, __pyx_L1_error)

  /* "sweepea.pyx":2300
 * 
 * class Alias(EntityWrapper):
 *     def __init__(self, entity, name):             # <<<<<<<<<<<<<<
 *         super(Alias, self).__init__(entity)
 *         self.name = name
 */
  __pyx_tuple__240 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_entity, __pyx_n_s_name); if (unlikely(!__pyx_tuple__240)) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__240);
  __Pyx_GIVEREF(__pyx_tuple__240);
  __pyx_codeobj__241 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__240, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2300, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__241)) __PYX_ERR(0, 2300, __pyx_L1_error)

  /* "sweepea.pyx":2304
 *         self.name = name
 * 
 *     def alias(self, name):             # <<<<<<<<<<<<<<
 *         if not name:
 *             return self.entity
 */
  __pyx_tuple__242 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_name); if (unlikely(!__pyx_tuple__242)) __PYX_ERR(0, 2304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__242);
  __Pyx_GIVEREF(__pyx_tuple__242);
  __pyx_codeobj__243 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__242, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_alias, 2304, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__243)) __PYX_ERR(0, 2304, __pyx_L1_error)

  /* "sweepea.pyx":2310
 *         return self
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return ctx.sql(self.entity).literal(' AS "%s"' % self.name)
 * 
 */
  __pyx_tuple__244 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__244)) __PYX_ERR(0, 2310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__244);
  __Pyx_GIVEREF(__pyx_tuple__244);
  __pyx_codeobj__245 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__244, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2310, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__245)) __PYX_ERR(0, 2310, __pyx_L1_error)

  /* "sweepea.pyx":2315
 * 
 * class Negated(EntityWrapper):
 *     def __invert__(self):             # <<<<<<<<<<<<<<
 *         return self.entity
 * 
 */
  __pyx_tuple__246 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__246)) __PYX_ERR(0, 2315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__246);
  __Pyx_GIVEREF(__pyx_tuple__246);
  __pyx_codeobj__247 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__246, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_invert, 2315, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__247)) __PYX_ERR(0, 2315, __pyx_L1_error)

  /* "sweepea.pyx":2318
 *         return self.entity
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return ctx.literal(' NOT ').sql(self.entity)
 * 
 */
  __pyx_tuple__248 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__248)) __PYX_ERR(0, 2318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__248);
  __Pyx_GIVEREF(__pyx_tuple__248);
  __pyx_codeobj__249 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__248, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2318, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__249)) __PYX_ERR(0, 2318, __pyx_L1_error)

  /* "sweepea.pyx":2323
 * 
 * class Cast(EntityWrapper):
 *     def __init__(self, entity, cast):             # <<<<<<<<<<<<<<
 *         super(Cast, self).__init__(entity)
 *         self.cast = cast
 */
  __pyx_tuple__250 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_entity, __pyx_n_s_cast); if (unlikely(!__pyx_tuple__250)) __PYX_ERR(0, 2323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__250);
  __Pyx_GIVEREF(__pyx_tuple__250);
  __pyx_codeobj__251 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__250, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2323, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__251)) __PYX_ERR(0, 2323, __pyx_L1_error)

  /* "sweepea.pyx":2327
 *         self.cast = cast
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return (ctx
 *                 .literal('CAST(')
 */
  __pyx_tuple__252 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__252)) __PYX_ERR(0, 2327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__252);
  __Pyx_GIVEREF(__pyx_tuple__252);
  __pyx_codeobj__253 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__252, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2327, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__253)) __PYX_ERR(0, 2327, __pyx_L1_error)

  /* "sweepea.pyx":2335
 * 
 * class Ordering(EntityWrapper):
 *     def __init__(self, entity, direction, collation=None, nulls=None):             # <<<<<<<<<<<<<<
 *         super(Ordering, self).__init__(entity)
 *         self.direction = direction
 */
  __pyx_tuple__254 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_entity, __pyx_n_s_direction, __pyx_n_s_collation, __pyx_n_s_nulls); if (unlikely(!__pyx_tuple__254)) __PYX_ERR(0, 2335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__254);
  __Pyx_GIVEREF(__pyx_tuple__254);
  __pyx_codeobj__255 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__254, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2335, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__255)) __PYX_ERR(0, 2335, __pyx_L1_error)
  __pyx_tuple__256 = PyTuple_Pack(2, ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__256)) __PYX_ERR(0, 2335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__256);
  __Pyx_GIVEREF(__pyx_tuple__256);

  /* "sweepea.pyx":2341
 *         self.nulls = nulls
 * 
 *     def collate(self, collation=None):             # <<<<<<<<<<<<<<
 *         return Ordering(self.entity, self.direction, collation, self.nulls)
 * 
 */
  __pyx_tuple__257 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_collation); if (unlikely(!__pyx_tuple__257)) __PYX_ERR(0, 2341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__257);
  __Pyx_GIVEREF(__pyx_tuple__257);
  __pyx_codeobj__258 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__257, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_collate, 2341, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__258)) __PYX_ERR(0, 2341, __pyx_L1_error)
  __pyx_tuple__259 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__259)) __PYX_ERR(0, 2341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__259);
  __Pyx_GIVEREF(__pyx_tuple__259);

  /* "sweepea.pyx":2344
 *         return Ordering(self.entity, self.direction, collation, self.nulls)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.sql(self.entity).literal(' %s' % self.direction)
 *         if self.collation:
 */
  __pyx_tuple__260 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__260)) __PYX_ERR(0, 2344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__260);
  __Pyx_GIVEREF(__pyx_tuple__260);
  __pyx_codeobj__261 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__260, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__261)) __PYX_ERR(0, 2344, __pyx_L1_error)

  /* "sweepea.pyx":2353
 * 
 * 
 * def Asc(entity, collation=None, nulls=None):             # <<<<<<<<<<<<<<
 *     return Ordering(entity, 'ASC', collation, nulls)
 * 
 */
  __pyx_tuple__262 = PyTuple_Pack(3, __pyx_n_s_entity, __pyx_n_s_collation, __pyx_n_s_nulls); if (unlikely(!__pyx_tuple__262)) __PYX_ERR(0, 2353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__262);
  __Pyx_GIVEREF(__pyx_tuple__262);
  __pyx_codeobj__263 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__262, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_Asc, 2353, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__263)) __PYX_ERR(0, 2353, __pyx_L1_error)

  /* "sweepea.pyx":2357
 * 
 * 
 * def Desc(entity, collation=None, nulls=None):             # <<<<<<<<<<<<<<
 *     return Ordering(entity, 'DESC', collation, nulls)
 * 
 */
  __pyx_tuple__264 = PyTuple_Pack(3, __pyx_n_s_entity, __pyx_n_s_collation, __pyx_n_s_nulls); if (unlikely(!__pyx_tuple__264)) __PYX_ERR(0, 2357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__264);
  __Pyx_GIVEREF(__pyx_tuple__264);
  __pyx_codeobj__265 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__264, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_Desc, 2357, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__265)) __PYX_ERR(0, 2357, __pyx_L1_error)

  /* "sweepea.pyx":2362
 * 
 * class Entity(EntityBase):
 *     def __init__(self, *path):             # <<<<<<<<<<<<<<
 *         self._path = filter(None, path)
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)
 */
  __pyx_tuple__266 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_path_2, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__266)) __PYX_ERR(0, 2362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__266);
  __Pyx_GIVEREF(__pyx_tuple__266);
  __pyx_codeobj__267 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__266, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__267)) __PYX_ERR(0, 2362, __pyx_L1_error)

  /* "sweepea.pyx":2366
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return ctx.literal(self._quoted)
 * 
 */
  __pyx_tuple__268 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__268)) __PYX_ERR(0, 2366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__268);
  __Pyx_GIVEREF(__pyx_tuple__268);
  __pyx_codeobj__269 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__268, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2366, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__269)) __PYX_ERR(0, 2366, __pyx_L1_error)

  /* "sweepea.pyx":2371
 * 
 * class SQL(EntityBase):
 *     def __init__(self, sql, params=None):             # <<<<<<<<<<<<<<
 *         self.sql = sql
 *         self.params = params
 */
  __pyx_tuple__270 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_sql, __pyx_n_s_params); if (unlikely(!__pyx_tuple__270)) __PYX_ERR(0, 2371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__270);
  __Pyx_GIVEREF(__pyx_tuple__270);
  __pyx_codeobj__271 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__270, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2371, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__271)) __PYX_ERR(0, 2371, __pyx_L1_error)
  __pyx_tuple__272 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__272)) __PYX_ERR(0, 2371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__272);
  __Pyx_GIVEREF(__pyx_tuple__272);

  /* "sweepea.pyx":2375
 *         self.params = params
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.literal(self.sql)
 *         if self.params:
 */
  __pyx_tuple__273 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ctx, __pyx_n_s_param); if (unlikely(!__pyx_tuple__273)) __PYX_ERR(0, 2375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__273);
  __Pyx_GIVEREF(__pyx_tuple__273);
  __pyx_codeobj__274 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__273, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__274)) __PYX_ERR(0, 2375, __pyx_L1_error)

  /* "sweepea.pyx":2386
 * 
 * 
 * def Check(constraint):             # <<<<<<<<<<<<<<
 *     return SQL('CHECK (%s)' % constraint)
 * 
 */
  __pyx_tuple__275 = PyTuple_Pack(1, __pyx_n_s_constraint); if (unlikely(!__pyx_tuple__275)) __PYX_ERR(0, 2386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__275);
  __Pyx_GIVEREF(__pyx_tuple__275);
  __pyx_codeobj__276 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__275, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_Check, 2386, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__276)) __PYX_ERR(0, 2386, __pyx_L1_error)

  /* "sweepea.pyx":2391
 * 
 * class Function(EntityBase):
 *     def __init__(self, name, arguments):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arguments = arguments
 */
  __pyx_tuple__277 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_arguments); if (unlikely(!__pyx_tuple__277)) __PYX_ERR(0, 2391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__277);
  __Pyx_GIVEREF(__pyx_tuple__277);
  __pyx_codeobj__278 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__277, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2391, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__278)) __PYX_ERR(0, 2391, __pyx_L1_error)

  /* "sweepea.pyx":2395
 *         self.arguments = arguments
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         def decorator(*args):
 *             return Function(attr, args)
 */
  __pyx_tuple__279 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_attr, __pyx_n_s_decorator, __pyx_n_s_decorator); if (unlikely(!__pyx_tuple__279)) __PYX_ERR(0, 2395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__279);
  __Pyx_GIVEREF(__pyx_tuple__279);
  __pyx_codeobj__280 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__279, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_getattr, 2395, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__280)) __PYX_ERR(0, 2395, __pyx_L1_error)

  /* "sweepea.pyx":2400
 *         return decorator
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.literal(self.name)
 *         if not len(self.arguments):
 */
  __pyx_tuple__281 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_ctx, __pyx_n_s_arg); if (unlikely(!__pyx_tuple__281)) __PYX_ERR(0, 2400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__281);
  __Pyx_GIVEREF(__pyx_tuple__281);
  __pyx_codeobj__282 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__281, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2400, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__282)) __PYX_ERR(0, 2400, __pyx_L1_error)

  /* "sweepea.pyx":2410
 *         return ctx
 * 
 * fn = Function(None, None)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_tuple__283 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__283)) __PYX_ERR(0, 2410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__283);
  __Pyx_GIVEREF(__pyx_tuple__283);

  /* "sweepea.pyx":2414
 * 
 * class List(Node):
 *     def __init__(self, nodes, glue=' ', parentheses=False):             # <<<<<<<<<<<<<<
 *         self.nodes = nodes
 *         self.glue = glue
 */
  __pyx_tuple__284 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_nodes, __pyx_n_s_glue, __pyx_n_s_parentheses); if (unlikely(!__pyx_tuple__284)) __PYX_ERR(0, 2414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__284);
  __Pyx_GIVEREF(__pyx_tuple__284);
  __pyx_codeobj__285 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__284, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2414, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__285)) __PYX_ERR(0, 2414, __pyx_L1_error)
  __pyx_tuple__286 = PyTuple_Pack(2, ((PyObject*)__pyx_kp_s__57), ((PyObject *)Py_False)); if (unlikely(!__pyx_tuple__286)) __PYX_ERR(0, 2414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__286);
  __Pyx_GIVEREF(__pyx_tuple__286);

  /* "sweepea.pyx":2423
 *                 self.nodes[0].flat = True
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         n = len(self.nodes)
 *         if n == 0:
 */
  __pyx_tuple__287 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ctx, __pyx_n_s_n, __pyx_n_s_i); if (unlikely(!__pyx_tuple__287)) __PYX_ERR(0, 2423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__287);
  __Pyx_GIVEREF(__pyx_tuple__287);
  __pyx_codeobj__288 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__287, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__288)) __PYX_ERR(0, 2423, __pyx_L1_error)

  /* "sweepea.pyx":2435
 * 
 * 
 * def CommaList(nodes):             # <<<<<<<<<<<<<<
 *     return List(nodes, ', ')
 * 
 */
  __pyx_tuple__289 = PyTuple_Pack(1, __pyx_n_s_nodes); if (unlikely(!__pyx_tuple__289)) __PYX_ERR(0, 2435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__289);
  __Pyx_GIVEREF(__pyx_tuple__289);
  __pyx_codeobj__290 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__289, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_CommaList, 2435, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__290)) __PYX_ERR(0, 2435, __pyx_L1_error)

  /* "sweepea.pyx":2439
 * 
 * 
 * def EnclosedList(nodes):             # <<<<<<<<<<<<<<
 *     return List(nodes, ', ', True)
 * 
 */
  __pyx_tuple__291 = PyTuple_Pack(1, __pyx_n_s_nodes); if (unlikely(!__pyx_tuple__291)) __PYX_ERR(0, 2439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__291);
  __Pyx_GIVEREF(__pyx_tuple__291);
  __pyx_codeobj__292 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__291, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_EnclosedList, 2439, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__292)) __PYX_ERR(0, 2439, __pyx_L1_error)

  /* "sweepea.pyx":2446
 *     commit = True
 * 
 *     def __init__(self, order_by=None, limit=None, offset=None, **kwargs):             # <<<<<<<<<<<<<<
 *         super(Query, self).__init__(**kwargs)
 *         self._order_by, self._limit, self._offset = order_by, limit, offset
 */
  __pyx_tuple__293 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_order_by, __pyx_n_s_limit, __pyx_n_s_offset, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__293)) __PYX_ERR(0, 2446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__293);
  __Pyx_GIVEREF(__pyx_tuple__293);
  __pyx_codeobj__294 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__293, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2446, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__294)) __PYX_ERR(0, 2446, __pyx_L1_error)
  __pyx_tuple__295 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__295)) __PYX_ERR(0, 2446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__295);
  __Pyx_GIVEREF(__pyx_tuple__295);

  /* "sweepea.pyx":2452
 *         self._cursor = None
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         query = super(Query, self).clone()
 *         query._cursor = None
 */
  __pyx_tuple__296 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_query); if (unlikely(!__pyx_tuple__296)) __PYX_ERR(0, 2452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__296);
  __Pyx_GIVEREF(__pyx_tuple__296);
  __pyx_codeobj__297 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__296, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_clone, 2452, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__297)) __PYX_ERR(0, 2452, __pyx_L1_error)

  /* "sweepea.pyx":2458
 * 
 *     @Node.copy
 *     def with_(self, *cte_list):             # <<<<<<<<<<<<<<
 *         self._cte_list = cte_list
 * 
 */
  __pyx_tuple__298 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_cte_list_2); if (unlikely(!__pyx_tuple__298)) __PYX_ERR(0, 2458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__298);
  __Pyx_GIVEREF(__pyx_tuple__298);
  __pyx_codeobj__299 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__298, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_with, 2458, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__299)) __PYX_ERR(0, 2458, __pyx_L1_error)

  /* "sweepea.pyx":2462
 * 
 *     @Node.copy
 *     def order_by(self, *values):             # <<<<<<<<<<<<<<
 *         self._order_by = values
 * 
 */
  __pyx_tuple__300 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_values); if (unlikely(!__pyx_tuple__300)) __PYX_ERR(0, 2462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__300);
  __Pyx_GIVEREF(__pyx_tuple__300);
  __pyx_codeobj__301 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__300, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_order_by, 2462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__301)) __PYX_ERR(0, 2462, __pyx_L1_error)

  /* "sweepea.pyx":2466
 * 
 *     @Node.copy
 *     def order_by_extend(self, *values):             # <<<<<<<<<<<<<<
 *         self._order_by = ((self._order_by or ()) + values) or None
 * 
 */
  __pyx_tuple__302 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_values); if (unlikely(!__pyx_tuple__302)) __PYX_ERR(0, 2466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__302);
  __Pyx_GIVEREF(__pyx_tuple__302);
  __pyx_codeobj__303 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__302, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_order_by_extend, 2466, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__303)) __PYX_ERR(0, 2466, __pyx_L1_error)

  /* "sweepea.pyx":2470
 * 
 *     @Node.copy
 *     def limit(self, limit=None):             # <<<<<<<<<<<<<<
 *         self._limit = limit
 * 
 */
  __pyx_tuple__304 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_limit); if (unlikely(!__pyx_tuple__304)) __PYX_ERR(0, 2470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__304);
  __Pyx_GIVEREF(__pyx_tuple__304);
  __pyx_codeobj__305 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__304, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_limit, 2470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__305)) __PYX_ERR(0, 2470, __pyx_L1_error)
  __pyx_tuple__306 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__306)) __PYX_ERR(0, 2470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__306);
  __Pyx_GIVEREF(__pyx_tuple__306);

  /* "sweepea.pyx":2474
 * 
 *     @Node.copy
 *     def offset(self, offset=None):             # <<<<<<<<<<<<<<
 *         self._offset = offset
 * 
 */
  __pyx_tuple__307 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_offset); if (unlikely(!__pyx_tuple__307)) __PYX_ERR(0, 2474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__307);
  __Pyx_GIVEREF(__pyx_tuple__307);
  __pyx_codeobj__308 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__307, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_offset, 2474, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__308)) __PYX_ERR(0, 2474, __pyx_L1_error)
  __pyx_tuple__309 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__309)) __PYX_ERR(0, 2474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__309);
  __Pyx_GIVEREF(__pyx_tuple__309);

  /* "sweepea.pyx":2478
 * 
 *     @Node.copy
 *     def paginate(self, page, n=20):             # <<<<<<<<<<<<<<
 *         if page > 0:
 *             page -= 1
 */
  __pyx_tuple__310 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_page, __pyx_n_s_n); if (unlikely(!__pyx_tuple__310)) __PYX_ERR(0, 2478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__310);
  __Pyx_GIVEREF(__pyx_tuple__310);
  __pyx_codeobj__311 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__310, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_paginate, 2478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__311)) __PYX_ERR(0, 2478, __pyx_L1_error)
  __pyx_tuple__312 = PyTuple_Pack(1, ((PyObject *)__pyx_int_20)); if (unlikely(!__pyx_tuple__312)) __PYX_ERR(0, 2478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__312);
  __Pyx_GIVEREF(__pyx_tuple__312);

  /* "sweepea.pyx":2484
 *         self._offset = page * n
 * 
 *     def apply_ordering(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self._order_by:
 *             ctx.literal(' ORDER BY ').sql(CommaList(self._order_by))
 */
  __pyx_tuple__313 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__313)) __PYX_ERR(0, 2484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__313);
  __Pyx_GIVEREF(__pyx_tuple__313);
  __pyx_codeobj__314 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__313, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_apply_ordering, 2484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__314)) __PYX_ERR(0, 2484, __pyx_L1_error)

  /* "sweepea.pyx":2493
 *         return ctx
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self._cte_list:
 *             recursive = any(cte._recursive for cte in self._cte_list)
 */
  __pyx_tuple__315 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_ctx, __pyx_n_s_recursive, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!__pyx_tuple__315)) __PYX_ERR(0, 2493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__315);
  __Pyx_GIVEREF(__pyx_tuple__315);
  __pyx_codeobj__316 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__315, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2493, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__316)) __PYX_ERR(0, 2493, __pyx_L1_error)

  /* "sweepea.pyx":2503
 *         return ctx
 * 
 *     def execute(self, database):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_tuple__317 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_database); if (unlikely(!__pyx_tuple__317)) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__317);
  __Pyx_GIVEREF(__pyx_tuple__317);
  __pyx_codeobj__318 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__317, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_execute, 2503, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__318)) __PYX_ERR(0, 2503, __pyx_L1_error)

  /* "sweepea.pyx":2510
 *     commit = False
 * 
 *     def __add__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'UNION ALL', rhs)
 *     def __or__(self, rhs):
 */
  __pyx_tuple__319 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rhs); if (unlikely(!__pyx_tuple__319)) __PYX_ERR(0, 2510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__319);
  __Pyx_GIVEREF(__pyx_tuple__319);
  __pyx_codeobj__320 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__319, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_add, 2510, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__320)) __PYX_ERR(0, 2510, __pyx_L1_error)

  /* "sweepea.pyx":2512
 *     def __add__(self, rhs):
 *         return CompoundSelect(self, 'UNION ALL', rhs)
 *     def __or__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'UNION', rhs)
 *     def __and__(self, rhs):
 */
  __pyx_tuple__321 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rhs); if (unlikely(!__pyx_tuple__321)) __PYX_ERR(0, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__321);
  __Pyx_GIVEREF(__pyx_tuple__321);
  __pyx_codeobj__322 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__321, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_or, 2512, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__322)) __PYX_ERR(0, 2512, __pyx_L1_error)

  /* "sweepea.pyx":2514
 *     def __or__(self, rhs):
 *         return CompoundSelect(self, 'UNION', rhs)
 *     def __and__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'INTERSECT', rhs)
 *     def __sub__(self, rhs):
 */
  __pyx_tuple__323 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rhs); if (unlikely(!__pyx_tuple__323)) __PYX_ERR(0, 2514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__323);
  __Pyx_GIVEREF(__pyx_tuple__323);
  __pyx_codeobj__324 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__323, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_and_2, 2514, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__324)) __PYX_ERR(0, 2514, __pyx_L1_error)

  /* "sweepea.pyx":2516
 *     def __and__(self, rhs):
 *         return CompoundSelect(self, 'INTERSECT', rhs)
 *     def __sub__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'EXCEPT', rhs)
 *     def cte(self, name, recursive=False, columns=None):
 */
  __pyx_tuple__325 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_rhs); if (unlikely(!__pyx_tuple__325)) __PYX_ERR(0, 2516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__325);
  __Pyx_GIVEREF(__pyx_tuple__325);
  __pyx_codeobj__326 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__325, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sub, 2516, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__326)) __PYX_ERR(0, 2516, __pyx_L1_error)

  /* "sweepea.pyx":2518
 *     def __sub__(self, rhs):
 *         return CompoundSelect(self, 'EXCEPT', rhs)
 *     def cte(self, name, recursive=False, columns=None):             # <<<<<<<<<<<<<<
 *         return CTE(name, self, recursive, columns)
 * 
 */
  __pyx_tuple__327 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_name, __pyx_n_s_recursive, __pyx_n_s_columns); if (unlikely(!__pyx_tuple__327)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__327);
  __Pyx_GIVEREF(__pyx_tuple__327);
  __pyx_codeobj__328 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__327, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_cte, 2518, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__328)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __pyx_tuple__329 = PyTuple_Pack(2, ((PyObject *)Py_False), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__329)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__329);
  __Pyx_GIVEREF(__pyx_tuple__329);

  /* "sweepea.pyx":2523
 * 
 * class CompoundSelect(SelectBase):
 *     def __init__(self, lhs, op, rhs):             # <<<<<<<<<<<<<<
 *         super(CompoundSelect, self).__init__()
 *         self.lhs = lhs
 */
  __pyx_tuple__330 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_lhs, __pyx_n_s_op, __pyx_n_s_rhs); if (unlikely(!__pyx_tuple__330)) __PYX_ERR(0, 2523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__330);
  __Pyx_GIVEREF(__pyx_tuple__330);
  __pyx_codeobj__331 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__330, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2523, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__331)) __PYX_ERR(0, 2523, __pyx_L1_error)

  /* "sweepea.pyx":2529
 *         self.rhs = rhs
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         with ctx(parentheses=ctx.scope == SCOPE_SOURCE):
 *             with ctx(parentheses=False):
 */
  __pyx_tuple__332 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__332)) __PYX_ERR(0, 2529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__332);
  __Pyx_GIVEREF(__pyx_tuple__332);
  __pyx_codeobj__333 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__332, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2529, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__333)) __PYX_ERR(0, 2529, __pyx_L1_error)

  /* "sweepea.pyx":2539
 *         return self.apply_alias(ctx)
 * 
 *     def execute(self, database):             # <<<<<<<<<<<<<<
 *         return CursorWrapper(database.execute(self))
 * 
 */
  __pyx_tuple__334 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_database); if (unlikely(!__pyx_tuple__334)) __PYX_ERR(0, 2539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__334);
  __Pyx_GIVEREF(__pyx_tuple__334);
  __pyx_codeobj__335 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__334, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_execute, 2539, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__335)) __PYX_ERR(0, 2539, __pyx_L1_error)

  /* "sweepea.pyx":2544
 * 
 * class Select(SelectBase):
 *     def __init__(self, from_clause=None, columns=None, where=None,             # <<<<<<<<<<<<<<
 *                  group_by=None, having=None, order_by=None, limit=None,
 *                  offset=None, distinct=None):
 */
  __pyx_tuple__336 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_from_clause, __pyx_n_s_columns, __pyx_n_s_where, __pyx_n_s_group_by, __pyx_n_s_having, __pyx_n_s_order_by, __pyx_n_s_limit, __pyx_n_s_offset, __pyx_n_s_distinct); if (unlikely(!__pyx_tuple__336)) __PYX_ERR(0, 2544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__336);
  __Pyx_GIVEREF(__pyx_tuple__336);
  __pyx_codeobj__337 = (PyObject*)__Pyx_PyCode_New(10, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__336, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2544, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__337)) __PYX_ERR(0, 2544, __pyx_L1_error)
  __pyx_tuple__338 = PyTuple_Pack(9, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__338)) __PYX_ERR(0, 2544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__338);
  __Pyx_GIVEREF(__pyx_tuple__338);

  /* "sweepea.pyx":2563
 * 
 *     @Node.copy
 *     def select(self, *columns):             # <<<<<<<<<<<<<<
 *         self._columns = columns
 * 
 */
  __pyx_tuple__339 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_columns); if (unlikely(!__pyx_tuple__339)) __PYX_ERR(0, 2563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__339);
  __Pyx_GIVEREF(__pyx_tuple__339);
  __pyx_codeobj__340 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__339, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_select, 2563, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__340)) __PYX_ERR(0, 2563, __pyx_L1_error)

  /* "sweepea.pyx":2567
 * 
 *     @Node.copy
 *     def join(self, dest, join_type='INNER', on=None):             # <<<<<<<<<<<<<<
 *         if not self._from:
 *             raise ValueError('No sources to join on.')
 */
  __pyx_tuple__341 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_dest, __pyx_n_s_join_type, __pyx_n_s_on, __pyx_n_s_item); if (unlikely(!__pyx_tuple__341)) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__341);
  __Pyx_GIVEREF(__pyx_tuple__341);
  __pyx_codeobj__342 = (PyObject*)__Pyx_PyCode_New(4, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__341, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_join, 2567, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__342)) __PYX_ERR(0, 2567, __pyx_L1_error)
  __pyx_tuple__343 = PyTuple_Pack(2, ((PyObject*)__pyx_n_s_INNER), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__343)) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__343);
  __Pyx_GIVEREF(__pyx_tuple__343);

  /* "sweepea.pyx":2574
 * 
 *     @Node.copy
 *     def where(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 */
  __pyx_tuple__344 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_expressions); if (unlikely(!__pyx_tuple__344)) __PYX_ERR(0, 2574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__344);
  __Pyx_GIVEREF(__pyx_tuple__344);
  __pyx_codeobj__345 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__344, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_where, 2574, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__345)) __PYX_ERR(0, 2574, __pyx_L1_error)

  /* "sweepea.pyx":2580
 * 
 *     @Node.copy
 *     def group_by(self, *columns):             # <<<<<<<<<<<<<<
 *         self._group_by = columns
 * 
 */
  __pyx_tuple__346 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_columns); if (unlikely(!__pyx_tuple__346)) __PYX_ERR(0, 2580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__346);
  __Pyx_GIVEREF(__pyx_tuple__346);
  __pyx_codeobj__347 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__346, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_group_by, 2580, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__347)) __PYX_ERR(0, 2580, __pyx_L1_error)

  /* "sweepea.pyx":2584
 * 
 *     @Node.copy
 *     def group_by_extend(self, *columns):             # <<<<<<<<<<<<<<
 *         self._group_by = ((self._group_by or ()) + columns) or None
 * 
 */
  __pyx_tuple__348 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_columns); if (unlikely(!__pyx_tuple__348)) __PYX_ERR(0, 2584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__348);
  __Pyx_GIVEREF(__pyx_tuple__348);
  __pyx_codeobj__349 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__348, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_group_by_extend, 2584, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__349)) __PYX_ERR(0, 2584, __pyx_L1_error)

  /* "sweepea.pyx":2588
 * 
 *     @Node.copy
 *     def having(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._having is not None:
 *             expressions = (self._having,) + expressions
 */
  __pyx_tuple__350 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_expressions); if (unlikely(!__pyx_tuple__350)) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__350);
  __Pyx_GIVEREF(__pyx_tuple__350);
  __pyx_codeobj__351 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__350, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_having, 2588, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__351)) __PYX_ERR(0, 2588, __pyx_L1_error)

  /* "sweepea.pyx":2594
 * 
 *     @Node.copy
 *     def distinct(self, is_distinct=True):             # <<<<<<<<<<<<<<
 *         self._distinct = is_distinct
 * 
 */
  __pyx_tuple__352 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_is_distinct); if (unlikely(!__pyx_tuple__352)) __PYX_ERR(0, 2594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__352);
  __Pyx_GIVEREF(__pyx_tuple__352);
  __pyx_codeobj__353 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__352, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_distinct, 2594, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__353)) __PYX_ERR(0, 2594, __pyx_L1_error)
  __pyx_tuple__354 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__354)) __PYX_ERR(0, 2594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__354);
  __Pyx_GIVEREF(__pyx_tuple__354);

  /* "sweepea.pyx":2598
 * 
 *     @Node.copy
 *     def dicts(self, as_dict=True):             # <<<<<<<<<<<<<<
 *         self._dicts = as_dict
 * 
 */
  __pyx_tuple__355 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_as_dict); if (unlikely(!__pyx_tuple__355)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__355);
  __Pyx_GIVEREF(__pyx_tuple__355);
  __pyx_codeobj__356 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__355, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_dicts_2, 2598, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__356)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __pyx_tuple__357 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__357)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__357);
  __Pyx_GIVEREF(__pyx_tuple__357);

  /* "sweepea.pyx":2602
 * 
 *     @Node.copy
 *     def objects(self, as_object=True):             # <<<<<<<<<<<<<<
 *         self._objects = as_object
 * 
 */
  __pyx_tuple__358 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_as_object); if (unlikely(!__pyx_tuple__358)) __PYX_ERR(0, 2602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__358);
  __Pyx_GIVEREF(__pyx_tuple__358);
  __pyx_codeobj__359 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__358, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_objects_2, 2602, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__359)) __PYX_ERR(0, 2602, __pyx_L1_error)
  __pyx_tuple__360 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__360)) __PYX_ERR(0, 2602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__360);
  __Pyx_GIVEREF(__pyx_tuple__360);

  /* "sweepea.pyx":2605
 *         self._objects = as_object
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         super(Select, self).__sql__(ctx)
 *         is_subquery = ctx.subquery
 */
  __pyx_tuple__361 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ctx, __pyx_n_s_is_subquery, __pyx_n_s_parentheses); if (unlikely(!__pyx_tuple__361)) __PYX_ERR(0, 2605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__361);
  __Pyx_GIVEREF(__pyx_tuple__361);
  __pyx_codeobj__362 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__361, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2605, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__362)) __PYX_ERR(0, 2605, __pyx_L1_error)

  /* "sweepea.pyx":2631
 *         return self.apply_alias(ctx)
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         cursor = database.execute(self)
 *         if self._dicts:
 */
  __pyx_tuple__363 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_database, __pyx_n_s_cursor); if (unlikely(!__pyx_tuple__363)) __PYX_ERR(0, 2631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__363);
  __Pyx_GIVEREF(__pyx_tuple__363);
  __pyx_codeobj__364 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__363, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_execute, 2631, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__364)) __PYX_ERR(0, 2631, __pyx_L1_error)

  /* "sweepea.pyx":2642
 * 
 * class WriteQuery(Query):
 *     def __init__(self, table, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         super(WriteQuery, self).__init__(*args, **kwargs)
 *         self.table = table
 */
  __pyx_tuple__365 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_table, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__365)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__365);
  __Pyx_GIVEREF(__pyx_tuple__365);
  __pyx_codeobj__366 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__365, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2642, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__366)) __PYX_ERR(0, 2642, __pyx_L1_error)

  /* "sweepea.pyx":2648
 * 
 * class Update(WriteQuery):
 *     def __init__(self, table, data=None, where=None, order_by=None, limit=None,             # <<<<<<<<<<<<<<
 *                  offset=None, on_conflict=None):
 *         super(Update, self).__init__(table, order_by=order_by, limit=limit,
 */
  __pyx_tuple__367 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_table, __pyx_n_s_data, __pyx_n_s_where, __pyx_n_s_order_by, __pyx_n_s_limit, __pyx_n_s_offset, __pyx_n_s_on_conflict); if (unlikely(!__pyx_tuple__367)) __PYX_ERR(0, 2648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__367);
  __Pyx_GIVEREF(__pyx_tuple__367);
  __pyx_codeobj__368 = (PyObject*)__Pyx_PyCode_New(8, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__367, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2648, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__368)) __PYX_ERR(0, 2648, __pyx_L1_error)
  __pyx_tuple__369 = PyTuple_Pack(6, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__369)) __PYX_ERR(0, 2648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__369);
  __Pyx_GIVEREF(__pyx_tuple__369);

  /* "sweepea.pyx":2657
 * 
 *     @Node.copy
 *     def where(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 */
  __pyx_tuple__370 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_expressions); if (unlikely(!__pyx_tuple__370)) __PYX_ERR(0, 2657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__370);
  __Pyx_GIVEREF(__pyx_tuple__370);
  __pyx_codeobj__371 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__370, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_where, 2657, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__371)) __PYX_ERR(0, 2657, __pyx_L1_error)

  /* "sweepea.pyx":2663
 * 
 *     @Node.copy
 *     def on_conflict(self, on_conflict):             # <<<<<<<<<<<<<<
 *         self._on_conflict = on_conflict
 * 
 */
  __pyx_tuple__372 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_on_conflict); if (unlikely(!__pyx_tuple__372)) __PYX_ERR(0, 2663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__372);
  __Pyx_GIVEREF(__pyx_tuple__372);
  __pyx_codeobj__373 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__372, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_on_conflict, 2663, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__373)) __PYX_ERR(0, 2663, __pyx_L1_error)

  /* "sweepea.pyx":2666
 *         self._on_conflict = on_conflict
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         with ctx.scope_values(subquery=True):
 *             ctx.literal('UPDATE ')
 */
  __pyx_tuple__374 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_ctx, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__374)) __PYX_ERR(0, 2666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__374);
  __Pyx_GIVEREF(__pyx_tuple__374);
  __pyx_codeobj__375 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__374, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2666, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__375)) __PYX_ERR(0, 2666, __pyx_L1_error)

  /* "sweepea.pyx":2684
 *             return self.apply_ordering(ctx)
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         database.execute(self)
 *         return database.changes()
 */
  __pyx_tuple__376 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_database); if (unlikely(!__pyx_tuple__376)) __PYX_ERR(0, 2684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__376);
  __Pyx_GIVEREF(__pyx_tuple__376);
  __pyx_codeobj__377 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__376, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_execute, 2684, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__377)) __PYX_ERR(0, 2684, __pyx_L1_error)

  /* "sweepea.pyx":2690
 * 
 * class Insert(WriteQuery):
 *     def __init__(self, table, data=None, columns=None, on_conflict=None):             # <<<<<<<<<<<<<<
 *         super(Insert, self).__init__(table)
 *         self.data = data
 */
  __pyx_tuple__378 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_table, __pyx_n_s_data, __pyx_n_s_columns, __pyx_n_s_on_conflict); if (unlikely(!__pyx_tuple__378)) __PYX_ERR(0, 2690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__378);
  __Pyx_GIVEREF(__pyx_tuple__378);
  __pyx_codeobj__379 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__378, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2690, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__379)) __PYX_ERR(0, 2690, __pyx_L1_error)
  __pyx_tuple__380 = PyTuple_Pack(3, ((PyObject *)Py_None), ((PyObject *)Py_None), ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__380)) __PYX_ERR(0, 2690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__380);
  __Pyx_GIVEREF(__pyx_tuple__380);

  /* "sweepea.pyx":2697
 * 
 *     @Node.copy
 *     def on_conflict(self, on_conflict):             # <<<<<<<<<<<<<<
 *         self._on_conflict = on_conflict
 * 
 */
  __pyx_tuple__381 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_on_conflict); if (unlikely(!__pyx_tuple__381)) __PYX_ERR(0, 2697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__381);
  __Pyx_GIVEREF(__pyx_tuple__381);
  __pyx_codeobj__382 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__381, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_on_conflict, 2697, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__382)) __PYX_ERR(0, 2697, __pyx_L1_error)

  /* "sweepea.pyx":2700
 *         self._on_conflict = on_conflict
 * 
 *     def _simple_insert(self, Context ctx):             # <<<<<<<<<<<<<<
 *         columns, values = [], []
 *         for key, value in self.data.items():
 */
  __pyx_tuple__383 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_ctx, __pyx_n_s_columns, __pyx_n_s_values, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__383)) __PYX_ERR(0, 2700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__383);
  __Pyx_GIVEREF(__pyx_tuple__383);
  __pyx_codeobj__384 = (PyObject*)__Pyx_PyCode_New(2, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__383, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_simple_insert, 2700, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__384)) __PYX_ERR(0, 2700, __pyx_L1_error)

  /* "sweepea.pyx":2712
 *                 .sql(EnclosedList(values)))
 * 
 *     def _multi_insert(self, Context ctx):             # <<<<<<<<<<<<<<
 *         rows_iter = iter(self.data)
 *         columns = self._columns
 */
  __pyx_tuple__385 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_ctx, __pyx_n_s_rows_iter, __pyx_n_s_columns, __pyx_n_s_row, __pyx_n_s_all_values, __pyx_n_s_values, __pyx_n_s_column, __pyx_n_s_value); if (unlikely(!__pyx_tuple__385)) __PYX_ERR(0, 2712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__385);
  __Pyx_GIVEREF(__pyx_tuple__385);
  __pyx_codeobj__386 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__385, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_multi_insert, 2712, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__386)) __PYX_ERR(0, 2712, __pyx_L1_error)

  /* "sweepea.pyx":2737
 *         return ctx.sql(CommaList(all_values))
 * 
 *     def _query_insert(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return (ctx
 *                 .sql(EnclosedList(self._columns))
 */
  __pyx_tuple__387 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__387)) __PYX_ERR(0, 2737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__387);
  __Pyx_GIVEREF(__pyx_tuple__387);
  __pyx_codeobj__388 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__387, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_query_insert, 2737, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__388)) __PYX_ERR(0, 2737, __pyx_L1_error)

  /* "sweepea.pyx":2743
 *                 .sql(self.data))
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         super(Insert, self).__sql__(ctx)
 *         with ctx.scope_values():
 */
  __pyx_tuple__389 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__389)) __PYX_ERR(0, 2743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__389);
  __Pyx_GIVEREF(__pyx_tuple__389);
  __pyx_codeobj__390 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__389, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2743, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__390)) __PYX_ERR(0, 2743, __pyx_L1_error)

  /* "sweepea.pyx":2758
 *         return ctx
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         database.execute(self)
 *         return database.last_insert_rowid()
 */
  __pyx_tuple__391 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_database); if (unlikely(!__pyx_tuple__391)) __PYX_ERR(0, 2758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__391);
  __Pyx_GIVEREF(__pyx_tuple__391);
  __pyx_codeobj__392 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__391, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_execute, 2758, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__392)) __PYX_ERR(0, 2758, __pyx_L1_error)

  /* "sweepea.pyx":2764
 * 
 * class Delete(WriteQuery):
 *     def __init__(self, table, where=None, **kwargs):             # <<<<<<<<<<<<<<
 *         super(Delete, self).__init__(table, **kwargs)
 *         self._where = where
 */
  __pyx_tuple__393 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_table, __pyx_n_s_where, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__393)) __PYX_ERR(0, 2764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__393);
  __Pyx_GIVEREF(__pyx_tuple__393);
  __pyx_codeobj__394 = (PyObject*)__Pyx_PyCode_New(3, 0, 4, 0, CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__393, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_init, 2764, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__394)) __PYX_ERR(0, 2764, __pyx_L1_error)
  __pyx_tuple__395 = PyTuple_Pack(1, ((PyObject *)Py_None)); if (unlikely(!__pyx_tuple__395)) __PYX_ERR(0, 2764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__395);
  __Pyx_GIVEREF(__pyx_tuple__395);

  /* "sweepea.pyx":2769
 * 
 *     @Node.copy
 *     def where(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 */
  __pyx_tuple__396 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_expressions); if (unlikely(!__pyx_tuple__396)) __PYX_ERR(0, 2769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__396);
  __Pyx_GIVEREF(__pyx_tuple__396);
  __pyx_codeobj__397 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__396, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_where, 2769, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__397)) __PYX_ERR(0, 2769, __pyx_L1_error)

  /* "sweepea.pyx":2774
 *         self._where = reduce(operator.and_, expressions)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         super(Delete, self).__sql__(ctx)
 * 
 */
  __pyx_tuple__398 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_ctx); if (unlikely(!__pyx_tuple__398)) __PYX_ERR(0, 2774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__398);
  __Pyx_GIVEREF(__pyx_tuple__398);
  __pyx_codeobj__399 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__398, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_sql_2, 2774, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__399)) __PYX_ERR(0, 2774, __pyx_L1_error)

  /* "sweepea.pyx":2783
 *             return self.apply_ordering(ctx)
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         database.execute(self)
 *         return database.changes()
 */
  __pyx_tuple__400 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_database); if (unlikely(!__pyx_tuple__400)) __PYX_ERR(0, 2783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__400);
  __Pyx_GIVEREF(__pyx_tuple__400);
  __pyx_codeobj__401 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__400, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_charles_code_sweepea_sweep, __pyx_n_s_execute, 2783, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__401)) __PYX_ERR(0, 2783, __pyx_L1_error)

  /* "sweepea.pyx":2788
 * 
 * SQLITE_DATETIME_FORMATS = (
 *     '%Y-%m-%d %H:%M:%S',             # <<<<<<<<<<<<<<
 *     '%Y-%m-%d %H:%M:%S.%f',
 *     '%Y-%m-%d',
 */
  __pyx_tuple__402 = PyTuple_Pack(6, __pyx_kp_s_Y_m_d_H_M_S, __pyx_kp_s_Y_m_d_H_M_S_f, __pyx_kp_s_Y_m_d, __pyx_kp_s_H_M_S, __pyx_kp_s_H_M_S_f, __pyx_kp_s_H_M); if (unlikely(!__pyx_tuple__402)) __PYX_ERR(0, 2788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__402);
  __Pyx_GIVEREF(__pyx_tuple__402);

  /* "sweepea.pyx":2795
 *     '%H:%M')
 * SQLITE_DATE_FORMATS = (
 *     '%Y-%m-%d',             # <<<<<<<<<<<<<<
 *     '%Y-%m-%d %H:%M:%S',
 *     '%Y-%m-%d %H:%M:%S.%f')
 */
  __pyx_tuple__403 = PyTuple_Pack(3, __pyx_kp_s_Y_m_d, __pyx_kp_s_Y_m_d_H_M_S, __pyx_kp_s_Y_m_d_H_M_S_f); if (unlikely(!__pyx_tuple__403)) __PYX_ERR(0, 2795, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__403);
  __Pyx_GIVEREF(__pyx_tuple__403);

  /* "sweepea.pyx":2799
 *     '%Y-%m-%d %H:%M:%S.%f')
 * SQLITE_TIME_FORMATS = (
 *     '%H:%M:%S',             # <<<<<<<<<<<<<<
 *     '%H:%M:%S.%f',
 *     '%H:%M',
 */
  __pyx_tuple__404 = PyTuple_Pack(5, __pyx_kp_s_H_M_S, __pyx_kp_s_H_M_S_f, __pyx_kp_s_H_M, __pyx_kp_s_Y_m_d_H_M_S, __pyx_kp_s_Y_m_d_H_M_S_f); if (unlikely(!__pyx_tuple__404)) __PYX_ERR(0, 2799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__404);
  __Pyx_GIVEREF(__pyx_tuple__404);
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyList_Type_pop.type = (PyObject*)&PyList_Type;
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_20 = PyInt_FromLong(20); if (unlikely(!__pyx_int_20)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5000 = PyInt_FromLong(5000); if (unlikely(!__pyx_int_5000)) __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 initsweepea(void); /*proto*/
PyMODINIT_FUNC initsweepea(void)
#else
PyMODINIT_FUNC PyInit_sweepea(void); /*proto*/
PyMODINIT_FUNC PyInit_sweepea(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __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_sweepea(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("sweepea", __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_sweepea) {
    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, "sweepea")) {
      if (unlikely(PyDict_SetItemString(modules, "sweepea", __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 ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  __pyx_vtabptr_7sweepea__TableFunctionImpl = &__pyx_vtable_7sweepea__TableFunctionImpl;
  __pyx_vtable_7sweepea__TableFunctionImpl.create_module = (PyObject *(*)(struct __pyx_obj_7sweepea__TableFunctionImpl *, pysqlite_Connection *))__pyx_f_7sweepea_18_TableFunctionImpl_create_module;
  if (PyType_Ready(&__pyx_type_7sweepea__TableFunctionImpl) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
  __pyx_type_7sweepea__TableFunctionImpl.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7sweepea__TableFunctionImpl.tp_dict, __pyx_vtabptr_7sweepea__TableFunctionImpl) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "_TableFunctionImpl", (PyObject *)&__pyx_type_7sweepea__TableFunctionImpl) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
  __pyx_ptype_7sweepea__TableFunctionImpl = &__pyx_type_7sweepea__TableFunctionImpl;
  __pyx_vtabptr_7sweepea_CursorWrapper = &__pyx_vtable_7sweepea_CursorWrapper;
  __pyx_vtable_7sweepea_CursorWrapper.initialize = (PyObject *(*)(struct __pyx_obj_7sweepea_CursorWrapper *))__pyx_f_7sweepea_13CursorWrapper_initialize;
  __pyx_vtable_7sweepea_CursorWrapper.iterate = (PyObject *(*)(struct __pyx_obj_7sweepea_CursorWrapper *))__pyx_f_7sweepea_13CursorWrapper_iterate;
  __pyx_vtable_7sweepea_CursorWrapper.fill_cache = (PyObject *(*)(struct __pyx_obj_7sweepea_CursorWrapper *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_13CursorWrapper_fill_cache *__pyx_optional_args))__pyx_f_7sweepea_13CursorWrapper_fill_cache;
  if (PyType_Ready(&__pyx_type_7sweepea_CursorWrapper) < 0) __PYX_ERR(0, 845, __pyx_L1_error)
  __pyx_type_7sweepea_CursorWrapper.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7sweepea_CursorWrapper.tp_dict, __pyx_vtabptr_7sweepea_CursorWrapper) < 0) __PYX_ERR(0, 845, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "CursorWrapper", (PyObject *)&__pyx_type_7sweepea_CursorWrapper) < 0) __PYX_ERR(0, 845, __pyx_L1_error)
  __pyx_ptype_7sweepea_CursorWrapper = &__pyx_type_7sweepea_CursorWrapper;
  if (PyType_Ready(&__pyx_type_7sweepea_ResultIterator) < 0) __PYX_ERR(0, 821, __pyx_L1_error)
  __pyx_type_7sweepea_ResultIterator.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "ResultIterator", (PyObject *)&__pyx_type_7sweepea_ResultIterator) < 0) __PYX_ERR(0, 821, __pyx_L1_error)
  __pyx_ptype_7sweepea_ResultIterator = &__pyx_type_7sweepea_ResultIterator;
  __pyx_vtabptr_7sweepea_NamedTupleCursorWrapper = &__pyx_vtable_7sweepea_NamedTupleCursorWrapper;
  __pyx_vtable_7sweepea_NamedTupleCursorWrapper.__pyx_base = *__pyx_vtabptr_7sweepea_CursorWrapper;
  __pyx_vtable_7sweepea_NamedTupleCursorWrapper.__pyx_base.initialize = (PyObject *(*)(struct __pyx_obj_7sweepea_CursorWrapper *))__pyx_f_7sweepea_23NamedTupleCursorWrapper_initialize;
  __pyx_type_7sweepea_NamedTupleCursorWrapper.tp_base = __pyx_ptype_7sweepea_CursorWrapper;
  if (PyType_Ready(&__pyx_type_7sweepea_NamedTupleCursorWrapper) < 0) __PYX_ERR(0, 943, __pyx_L1_error)
  __pyx_type_7sweepea_NamedTupleCursorWrapper.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7sweepea_NamedTupleCursorWrapper.tp_dict, __pyx_vtabptr_7sweepea_NamedTupleCursorWrapper) < 0) __PYX_ERR(0, 943, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "NamedTupleCursorWrapper", (PyObject *)&__pyx_type_7sweepea_NamedTupleCursorWrapper) < 0) __PYX_ERR(0, 943, __pyx_L1_error)
  __pyx_ptype_7sweepea_NamedTupleCursorWrapper = &__pyx_type_7sweepea_NamedTupleCursorWrapper;
  if (PyType_Ready(&__pyx_type_7sweepea__callable_context_manager) < 0) __PYX_ERR(0, 953, __pyx_L1_error)
  __pyx_type_7sweepea__callable_context_manager.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_callable_context_manager", (PyObject *)&__pyx_type_7sweepea__callable_context_manager) < 0) __PYX_ERR(0, 953, __pyx_L1_error)
  __pyx_ptype_7sweepea__callable_context_manager = &__pyx_type_7sweepea__callable_context_manager;
  __pyx_vtabptr_7sweepea_Database = &__pyx_vtable_7sweepea_Database;
  __pyx_vtable_7sweepea_Database.connect = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_connect;
  __pyx_vtable_7sweepea_Database.close = (int (*)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_close;
  __pyx_vtable_7sweepea_Database._create_collation = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, PyObject *, PyObject *, PyObject *))__pyx_f_7sweepea_8Database__create_collation;
  __pyx_vtable_7sweepea_Database._create_function = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, PyObject *, PyObject *, PyObject *, PyObject *, PyObject *))__pyx_f_7sweepea_8Database__create_function;
  __pyx_vtable_7sweepea_Database.is_closed = (int (*)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_is_closed;
  __pyx_vtable_7sweepea_Database.get_conn = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *))__pyx_f_7sweepea_8Database_get_conn;
  __pyx_vtable_7sweepea_Database.execute_sql = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_8Database_execute_sql *__pyx_optional_args))__pyx_f_7sweepea_8Database_execute_sql;
  __pyx_vtable_7sweepea_Database.execute = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_execute;
  __pyx_vtable_7sweepea_Database.sql = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_sql;
  __pyx_vtable_7sweepea_Database.commit = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_commit;
  __pyx_vtable_7sweepea_Database.rollback = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_rollback;
  __pyx_vtable_7sweepea_Database._push_transaction = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, PyObject *))__pyx_f_7sweepea_8Database__push_transaction;
  __pyx_vtable_7sweepea_Database._pop_transaction = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *))__pyx_f_7sweepea_8Database__pop_transaction;
  __pyx_vtable_7sweepea_Database._transaction_depth = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *))__pyx_f_7sweepea_8Database__transaction_depth;
  __pyx_vtable_7sweepea_Database.last_insert_rowid = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *))__pyx_f_7sweepea_8Database_last_insert_rowid;
  __pyx_vtable_7sweepea_Database.changes = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *))__pyx_f_7sweepea_8Database_changes;
  __pyx_vtable_7sweepea_Database.atomic = (struct __pyx_obj_7sweepea__atomic *(*)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_atomic;
  __pyx_vtable_7sweepea_Database.transaction = (struct __pyx_obj_7sweepea__transaction *(*)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_transaction;
  __pyx_vtable_7sweepea_Database.savepoint = (struct __pyx_obj_7sweepea__savepoint *(*)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_savepoint;
  __pyx_vtable_7sweepea_Database.get_tables = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_get_tables;
  __pyx_vtable_7sweepea_Database.get_indexes = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_get_indexes;
  __pyx_vtable_7sweepea_Database.get_columns = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_get_columns;
  __pyx_vtable_7sweepea_Database.get_primary_keys = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_get_primary_keys;
  __pyx_vtable_7sweepea_Database.get_foreign_keys = (PyObject *(*)(struct __pyx_obj_7sweepea_Database *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7sweepea_8Database_get_foreign_keys;
  if (PyType_Ready(&__pyx_type_7sweepea_Database) < 0) __PYX_ERR(0, 1142, __pyx_L1_error)
  __pyx_type_7sweepea_Database.tp_print = 0;
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_7sweepea_Database, "__getitem__"); if (unlikely(!wrapper)) __PYX_ERR(0, 1142, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_7sweepea_8Database_50__getitem__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_7sweepea_8Database_50__getitem__.doc = __pyx_doc_7sweepea_8Database_50__getitem__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_7sweepea_8Database_50__getitem__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_7sweepea_Database.tp_dict, __pyx_vtabptr_7sweepea_Database) < 0) __PYX_ERR(0, 1142, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "Database", (PyObject *)&__pyx_type_7sweepea_Database) < 0) __PYX_ERR(0, 1142, __pyx_L1_error)
  __pyx_ptype_7sweepea_Database = &__pyx_type_7sweepea_Database;
  __pyx_type_7sweepea__atomic.tp_base = __pyx_ptype_7sweepea__callable_context_manager;
  if (PyType_Ready(&__pyx_type_7sweepea__atomic) < 0) __PYX_ERR(0, 1811, __pyx_L1_error)
  __pyx_type_7sweepea__atomic.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_atomic", (PyObject *)&__pyx_type_7sweepea__atomic) < 0) __PYX_ERR(0, 1811, __pyx_L1_error)
  __pyx_ptype_7sweepea__atomic = &__pyx_type_7sweepea__atomic;
  __pyx_vtabptr_7sweepea__transaction = &__pyx_vtable_7sweepea__transaction;
  __pyx_vtable_7sweepea__transaction._begin = (PyObject *(*)(struct __pyx_obj_7sweepea__transaction *, int __pyx_skip_dispatch))__pyx_f_7sweepea_12_transaction__begin;
  __pyx_vtable_7sweepea__transaction.commit = (PyObject *(*)(struct __pyx_obj_7sweepea__transaction *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_12_transaction_commit *__pyx_optional_args))__pyx_f_7sweepea_12_transaction_commit;
  __pyx_vtable_7sweepea__transaction.rollback = (PyObject *(*)(struct __pyx_obj_7sweepea__transaction *, int __pyx_skip_dispatch, struct __pyx_opt_args_7sweepea_12_transaction_rollback *__pyx_optional_args))__pyx_f_7sweepea_12_transaction_rollback;
  __pyx_type_7sweepea__transaction.tp_base = __pyx_ptype_7sweepea__callable_context_manager;
  if (PyType_Ready(&__pyx_type_7sweepea__transaction) < 0) __PYX_ERR(0, 1830, __pyx_L1_error)
  __pyx_type_7sweepea__transaction.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7sweepea__transaction.tp_dict, __pyx_vtabptr_7sweepea__transaction) < 0) __PYX_ERR(0, 1830, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "_transaction", (PyObject *)&__pyx_type_7sweepea__transaction) < 0) __PYX_ERR(0, 1830, __pyx_L1_error)
  __pyx_ptype_7sweepea__transaction = &__pyx_type_7sweepea__transaction;
  __pyx_vtabptr_7sweepea__savepoint = &__pyx_vtable_7sweepea__savepoint;
  __pyx_vtable_7sweepea__savepoint._execute = (PyObject *(*)(struct __pyx_obj_7sweepea__savepoint *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7sweepea_10_savepoint__execute;
  __pyx_vtable_7sweepea__savepoint.commit = (PyObject *(*)(struct __pyx_obj_7sweepea__savepoint *, int __pyx_skip_dispatch))__pyx_f_7sweepea_10_savepoint_commit;
  __pyx_vtable_7sweepea__savepoint.rollback = (PyObject *(*)(struct __pyx_obj_7sweepea__savepoint *, int __pyx_skip_dispatch))__pyx_f_7sweepea_10_savepoint_rollback;
  __pyx_type_7sweepea__savepoint.tp_base = __pyx_ptype_7sweepea__callable_context_manager;
  if (PyType_Ready(&__pyx_type_7sweepea__savepoint) < 0) __PYX_ERR(0, 1873, __pyx_L1_error)
  __pyx_type_7sweepea__savepoint.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7sweepea__savepoint.tp_dict, __pyx_vtabptr_7sweepea__savepoint) < 0) __PYX_ERR(0, 1873, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "_savepoint", (PyObject *)&__pyx_type_7sweepea__savepoint) < 0) __PYX_ERR(0, 1873, __pyx_L1_error)
  __pyx_ptype_7sweepea__savepoint = &__pyx_type_7sweepea__savepoint;
  if (PyType_Ready(&__pyx_type_7sweepea_State) < 0) __PYX_ERR(0, 1914, __pyx_L1_error)
  __pyx_type_7sweepea_State.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "State", (PyObject *)&__pyx_type_7sweepea_State) < 0) __PYX_ERR(0, 1914, __pyx_L1_error)
  __pyx_ptype_7sweepea_State = &__pyx_type_7sweepea_State;
  __pyx_vtabptr_7sweepea_Context = &__pyx_vtable_7sweepea_Context;
  __pyx_vtable_7sweepea_Context.refresh = (PyObject *(*)(struct __pyx_obj_7sweepea_Context *))__pyx_f_7sweepea_7Context_refresh;
  __pyx_vtable_7sweepea_Context.sql = (struct __pyx_obj_7sweepea_Context *(*)(struct __pyx_obj_7sweepea_Context *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7sweepea_7Context_sql;
  __pyx_vtable_7sweepea_Context.literal = (struct __pyx_obj_7sweepea_Context *(*)(struct __pyx_obj_7sweepea_Context *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7sweepea_7Context_literal;
  __pyx_vtable_7sweepea_Context.bind_value = (struct __pyx_obj_7sweepea_Context *(*)(struct __pyx_obj_7sweepea_Context *, PyObject *))__pyx_f_7sweepea_7Context_bind_value;
  __pyx_vtable_7sweepea_Context.__pyx___sql__ = (struct __pyx_obj_7sweepea_Context *(*)(struct __pyx_obj_7sweepea_Context *, struct __pyx_obj_7sweepea_Context *))__pyx_f_7sweepea_7Context___sql__;
  __pyx_vtable_7sweepea_Context.parse = (PyObject *(*)(struct __pyx_obj_7sweepea_Context *, PyObject *, int __pyx_skip_dispatch))__pyx_f_7sweepea_7Context_parse;
  __pyx_vtable_7sweepea_Context.query = (PyObject *(*)(struct __pyx_obj_7sweepea_Context *, int __pyx_skip_dispatch))__pyx_f_7sweepea_7Context_query;
  if (PyType_Ready(&__pyx_type_7sweepea_Context) < 0) __PYX_ERR(0, 1943, __pyx_L1_error)
  __pyx_type_7sweepea_Context.tp_print = 0;
  if (__Pyx_SetVtable(__pyx_type_7sweepea_Context.tp_dict, __pyx_vtabptr_7sweepea_Context) < 0) __PYX_ERR(0, 1943, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "Context", (PyObject *)&__pyx_type_7sweepea_Context) < 0) __PYX_ERR(0, 1943, __pyx_L1_error)
  __pyx_ptype_7sweepea_Context = &__pyx_type_7sweepea_Context;
  if (PyType_Ready(&__pyx_type_7sweepea_ColumnFactory) < 0) __PYX_ERR(0, 2020, __pyx_L1_error)
  __pyx_type_7sweepea_ColumnFactory.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "ColumnFactory", (PyObject *)&__pyx_type_7sweepea_ColumnFactory) < 0) __PYX_ERR(0, 2020, __pyx_L1_error)
  __pyx_ptype_7sweepea_ColumnFactory = &__pyx_type_7sweepea_ColumnFactory;
  if (PyType_Ready(&__pyx_type_7sweepea__DynamicColumn) < 0) __PYX_ERR(0, 2039, __pyx_L1_error)
  __pyx_type_7sweepea__DynamicColumn.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_DynamicColumn", (PyObject *)&__pyx_type_7sweepea__DynamicColumn) < 0) __PYX_ERR(0, 2039, __pyx_L1_error)
  __pyx_ptype_7sweepea__DynamicColumn = &__pyx_type_7sweepea__DynamicColumn;
  if (PyType_Ready(&__pyx_type_7sweepea__ExplicitColumn) < 0) __PYX_ERR(0, 2049, __pyx_L1_error)
  __pyx_type_7sweepea__ExplicitColumn.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "_ExplicitColumn", (PyObject *)&__pyx_type_7sweepea__ExplicitColumn) < 0) __PYX_ERR(0, 2049, __pyx_L1_error)
  __pyx_ptype_7sweepea__ExplicitColumn = &__pyx_type_7sweepea__ExplicitColumn;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct__make_hash) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct__make_hash.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct__make_hash = &__pyx_type_7sweepea___pyx_scope_struct__make_hash;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_1_iterator) < 0) __PYX_ERR(0, 888, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_1_iterator.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_1_iterator = &__pyx_type_7sweepea___pyx_scope_struct_1_iterator;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_2___call__) < 0) __PYX_ERR(0, 954, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_2___call__.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_2___call__ = &__pyx_type_7sweepea___pyx_scope_struct_2___call__;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_3___status__) < 0) __PYX_ERR(0, 963, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_3___status__.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_3___status__ = &__pyx_type_7sweepea___pyx_scope_struct_3___status__;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_4___dbstatus__) < 0) __PYX_ERR(0, 981, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_4___dbstatus__.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_4___dbstatus__ = &__pyx_type_7sweepea___pyx_scope_struct_4___dbstatus__;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_5___pragma__) < 0) __PYX_ERR(0, 1005, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_5___pragma__.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_5___pragma__ = &__pyx_type_7sweepea___pyx_scope_struct_5___pragma__;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_6_aggregate) < 0) __PYX_ERR(0, 1307, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_6_aggregate.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_6_aggregate = &__pyx_type_7sweepea___pyx_scope_struct_6_aggregate;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_7_collation) < 0) __PYX_ERR(0, 1335, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_7_collation.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_7_collation = &__pyx_type_7sweepea___pyx_scope_struct_7_collation;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_8_func) < 0) __PYX_ERR(0, 1381, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_8_func.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_8_func = &__pyx_type_7sweepea___pyx_scope_struct_8_func;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_9_table_function) < 0) __PYX_ERR(0, 1400, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_9_table_function.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_9_table_function = &__pyx_type_7sweepea___pyx_scope_struct_9_table_function;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_10___scope_context__) < 0) __PYX_ERR(0, 1935, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_10___scope_context__.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_10___scope_context__ = &__pyx_type_7sweepea___pyx_scope_struct_10___scope_context__;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_11_inner) < 0) __PYX_ERR(0, 1937, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_11_inner.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_11_inner = &__pyx_type_7sweepea___pyx_scope_struct_11_inner;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_12_copy) < 0) __PYX_ERR(0, 2068, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_12_copy.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_12_copy = &__pyx_type_7sweepea___pyx_scope_struct_12_copy;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_13___e__) < 0) __PYX_ERR(0, 2203, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_13___e__.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_13___e__ = &__pyx_type_7sweepea___pyx_scope_struct_13___e__;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_14___init__) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_14___init__.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_14___init__ = &__pyx_type_7sweepea___pyx_scope_struct_14___init__;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_15_genexpr) < 0) __PYX_ERR(0, 2364, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_15_genexpr.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_15_genexpr = &__pyx_type_7sweepea___pyx_scope_struct_15_genexpr;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_16___getattr__) < 0) __PYX_ERR(0, 2395, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_16___getattr__.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_16___getattr__ = &__pyx_type_7sweepea___pyx_scope_struct_16___getattr__;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_17___sql__) < 0) __PYX_ERR(0, 2493, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_17___sql__.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_17___sql__ = &__pyx_type_7sweepea___pyx_scope_struct_17___sql__;
  if (PyType_Ready(&__pyx_type_7sweepea___pyx_scope_struct_18_genexpr) < 0) __PYX_ERR(0, 2495, __pyx_L1_error)
  __pyx_type_7sweepea___pyx_scope_struct_18_genexpr.tp_print = 0;
  __pyx_ptype_7sweepea___pyx_scope_struct_18_genexpr = &__pyx_type_7sweepea___pyx_scope_struct_18_genexpr;
  if (PyType_Ready(&__pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py) < 0) __PYX_ERR(2, 64, __pyx_L1_error)
  __pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py.tp_print = 0;
  __pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py = &__pyx_scope_struct____Pyx_CFunc_object____CursorWrapper____tuple___to_py;
  if (PyType_Ready(&__pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py) < 0) __PYX_ERR(2, 64, __pyx_L1_error)
  __pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py.tp_print = 0;
  __pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py = &__pyx_scope_struct____Pyx_CFunc_object____NamedTupleCursorWrapper____tuple___to_py;
  if (PyType_Ready(&__pyx_scope_struct____Pyx_CFunc_float____object___to_py) < 0) __PYX_ERR(2, 64, __pyx_L1_error)
  __pyx_scope_struct____Pyx_CFunc_float____object___to_py.tp_print = 0;
  __pyx_ptype___pyx_scope_struct____Pyx_CFunc_float____object___to_py = &__pyx_scope_struct____Pyx_CFunc_float____object___to_py;
  if (PyType_Ready(&__pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py) < 0) __PYX_ERR(2, 64, __pyx_L1_error)
  __pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py.tp_print = 0;
  __pyx_ptype___pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py = &__pyx_scope_struct____Pyx_CFunc_float____object____int____float____float___to_py;
  if (PyType_Ready(&__pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py) < 0) __PYX_ERR(2, 64, __pyx_L1_error)
  __pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py.tp_print = 0;
  __pyx_ptype___pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py = &__pyx_scope_struct____Pyx_CFunc_bint____basestring____basestring___to_py;
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if CYTHON_COMPILING_IN_PYPY
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error)
  __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) __PYX_ERR(4, 8, __pyx_L1_error)
  __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) __PYX_ERR(5, 15, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_date = __Pyx_ImportType("datetime", "date", sizeof(PyDateTime_Date), 0); if (unlikely(!__pyx_ptype_7cpython_8datetime_date)) __PYX_ERR(1, 9, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_time = __Pyx_ImportType("datetime", "time", sizeof(PyDateTime_Time), 0); if (unlikely(!__pyx_ptype_7cpython_8datetime_time)) __PYX_ERR(1, 12, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_datetime = __Pyx_ImportType("datetime", "datetime", sizeof(PyDateTime_DateTime), 0); if (unlikely(!__pyx_ptype_7cpython_8datetime_datetime)) __PYX_ERR(1, 15, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_timedelta = __Pyx_ImportType("datetime", "timedelta", sizeof(PyDateTime_Delta), 0); if (unlikely(!__pyx_ptype_7cpython_8datetime_timedelta)) __PYX_ERR(1, 18, __pyx_L1_error)
  __pyx_ptype_7cpython_8datetime_tzinfo = __Pyx_ImportType("datetime", "tzinfo", sizeof(PyDateTime_TZInfo), 0); if (unlikely(!__pyx_ptype_7cpython_8datetime_tzinfo)) __PYX_ERR(1, 21, __pyx_L1_error)
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "sweepea.pyx":10
 * from libc.string cimport memcpy, memset
 * 
 * from collections import namedtuple             # <<<<<<<<<<<<<<
 * from contextlib import contextmanager
 * import decimal
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_namedtuple);
  __Pyx_GIVEREF(__pyx_n_s_namedtuple);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_namedtuple);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_collections, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __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_namedtuple); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_namedtuple, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":11
 * 
 * from collections import namedtuple
 * from contextlib import contextmanager             # <<<<<<<<<<<<<<
 * import decimal
 * import hashlib
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_contextmanager);
  __Pyx_GIVEREF(__pyx_n_s_contextmanager);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_contextmanager);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_contextlib, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_contextmanager); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_contextmanager, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":12
 * from collections import namedtuple
 * from contextlib import contextmanager
 * import decimal             # <<<<<<<<<<<<<<
 * import hashlib
 * import itertools
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_decimal, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_decimal, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":13
 * from contextlib import contextmanager
 * import decimal
 * import hashlib             # <<<<<<<<<<<<<<
 * import itertools
 * import operator
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_hashlib, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_hashlib, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":14
 * import decimal
 * import hashlib
 * import itertools             # <<<<<<<<<<<<<<
 * import operator
 * import re
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_itertools, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_itertools, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":15
 * import hashlib
 * import itertools
 * import operator             # <<<<<<<<<<<<<<
 * import re
 * import sqlite3 as pysqlite
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_operator, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_operator, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":16
 * import itertools
 * import operator
 * import re             # <<<<<<<<<<<<<<
 * import sqlite3 as pysqlite
 * import struct
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_re, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_re, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":17
 * import operator
 * import re
 * import sqlite3 as pysqlite             # <<<<<<<<<<<<<<
 * import struct
 * import threading
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sqlite3, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pysqlite, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":18
 * import re
 * import sqlite3 as pysqlite
 * import struct             # <<<<<<<<<<<<<<
 * import threading
 * import uuid
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_struct, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":19
 * import sqlite3 as pysqlite
 * import struct
 * import threading             # <<<<<<<<<<<<<<
 * import uuid
 * from sqlite3 import DatabaseError
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_threading, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_threading, __pyx_t_1) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":20
 * import struct
 * import threading
 * import uuid             # <<<<<<<<<<<<<<
 * from sqlite3 import DatabaseError
 * from sqlite3 import InterfaceError
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_uuid, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_uuid, __pyx_t_1) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":21
 * import threading
 * import uuid
 * from sqlite3 import DatabaseError             # <<<<<<<<<<<<<<
 * from sqlite3 import InterfaceError
 * from sqlite3 import OperationalError
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_DatabaseError);
  __Pyx_GIVEREF(__pyx_n_s_DatabaseError);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_DatabaseError);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_sqlite3, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __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_DatabaseError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DatabaseError, __pyx_t_1) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":22
 * import uuid
 * from sqlite3 import DatabaseError
 * from sqlite3 import InterfaceError             # <<<<<<<<<<<<<<
 * from sqlite3 import OperationalError
 * 
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_InterfaceError);
  __Pyx_GIVEREF(__pyx_n_s_InterfaceError);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InterfaceError);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sqlite3, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InterfaceError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InterfaceError, __pyx_t_2) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":23
 * from sqlite3 import DatabaseError
 * from sqlite3 import InterfaceError
 * from sqlite3 import OperationalError             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_OperationalError);
  __Pyx_GIVEREF(__pyx_n_s_OperationalError);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_OperationalError);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_sqlite3, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __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_OperationalError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_OperationalError, __pyx_t_1) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":546
 * 
 * 
 * class TableFunction(object):             # <<<<<<<<<<<<<<
 *     """
 *     Implements a table-valued function (eponymous-only virtual table) in
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_builtin_object);
  __Pyx_GIVEREF(__pyx_builtin_object);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_builtin_object);
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_TableFunction, __pyx_n_s_TableFunction, (PyObject *) NULL, __pyx_n_s_sweepea, __pyx_kp_s_Implements_a_table_valued_funct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "sweepea.pyx":564
 *     a `StopIteration` to signal no more results.
 *     """
 *     columns = None             # <<<<<<<<<<<<<<
 *     params = None
 *     name = None
 */
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_columns, Py_None) < 0) __PYX_ERR(0, 564, __pyx_L1_error)

  /* "sweepea.pyx":565
 *     """
 *     columns = None
 *     params = None             # <<<<<<<<<<<<<<
 *     name = None
 *     _ncols = None
 */
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_params, Py_None) < 0) __PYX_ERR(0, 565, __pyx_L1_error)

  /* "sweepea.pyx":566
 *     columns = None
 *     params = None
 *     name = None             # <<<<<<<<<<<<<<
 *     _ncols = None
 * 
 */
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_name, Py_None) < 0) __PYX_ERR(0, 566, __pyx_L1_error)

  /* "sweepea.pyx":567
 *     params = None
 *     name = None
 *     _ncols = None             # <<<<<<<<<<<<<<
 * 
 *     @classmethod
 */
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_ncols, Py_None) < 0) __PYX_ERR(0, 567, __pyx_L1_error)

  /* "sweepea.pyx":570
 * 
 *     @classmethod
 *     def register(cls, conn):             # <<<<<<<<<<<<<<
 *         cdef _TableFunctionImpl impl = _TableFunctionImpl(cls)
 *         impl.create_module(<pysqlite_Connection *>conn)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_13TableFunction_1register, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_TableFunction_register, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "sweepea.pyx":569
 *     _ncols = None
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def register(cls, conn):
 *         cdef _TableFunctionImpl impl = _TableFunctionImpl(cls)
 */
  __pyx_t_5 = __Pyx_Method_ClassMethod(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_register, __pyx_t_5) < 0) __PYX_ERR(0, 570, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":575
 *         cls._ncols = len(cls.columns)
 * 
 *     def initialize(self, **filters):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_13TableFunction_3initialize, 0, __pyx_n_s_TableFunction_initialize, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_initialize, __pyx_t_5) < 0) __PYX_ERR(0, 575, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":578
 *         raise NotImplementedError
 * 
 *     def iterate(self, idx):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_13TableFunction_5iterate, 0, __pyx_n_s_TableFunction_iterate, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_iterate, __pyx_t_5) < 0) __PYX_ERR(0, 578, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":582
 * 
 *     @classmethod
 *     def get_table_columns_declaration(cls):             # <<<<<<<<<<<<<<
 *         cdef list accum = []
 * 
 */
  __pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_13TableFunction_7get_table_columns_declaration, __Pyx_CYFUNCTION_CLASSMETHOD, __pyx_n_s_TableFunction_get_table_columns, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":581
 *         raise NotImplementedError
 * 
 *     @classmethod             # <<<<<<<<<<<<<<
 *     def get_table_columns_declaration(cls):
 *         cdef list accum = []
 */
  __pyx_t_4 = __Pyx_Method_ClassMethod(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (PyObject_SetItem(__pyx_t_3, __pyx_n_s_get_table_columns_declaration, __pyx_t_4) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":546
 * 
 * 
 * class TableFunction(object):             # <<<<<<<<<<<<<<
 *     """
 *     Implements a table-valued function (eponymous-only virtual table) in
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_TableFunction, __pyx_t_2, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TableFunction, __pyx_t_4) < 0) __PYX_ERR(0, 546, __pyx_L1_error)
  __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;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":753
 * 
 * 
 * def murmurhash(key, seed=None):             # <<<<<<<<<<<<<<
 *     if key is None:
 *         return
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7sweepea_1murmurhash, NULL, __pyx_n_s_sweepea); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_murmurhash, __pyx_t_2) < 0) __PYX_ERR(0, 753, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":776
 * 
 * 
 * def make_hash(hash_impl):             # <<<<<<<<<<<<<<
 *     def inner(*items):
 *         state = hash_impl()
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7sweepea_3make_hash, NULL, __pyx_n_s_sweepea); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_make_hash, __pyx_t_2) < 0) __PYX_ERR(0, 776, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":785
 * 
 * 
 * hash_md5 = make_hash(hashlib.md5)             # <<<<<<<<<<<<<<
 * hash_sha1 = make_hash(hashlib.sha1)
 * hash_sha256 = make_hash(hashlib.sha256)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_make_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_hashlib); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_md5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 785, __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_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 785, __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_hash_md5, __pyx_t_2) < 0) __PYX_ERR(0, 785, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":786
 * 
 * hash_md5 = make_hash(hashlib.md5)
 * hash_sha1 = make_hash(hashlib.sha1)             # <<<<<<<<<<<<<<
 * hash_sha256 = make_hash(hashlib.sha256)
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_make_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_hashlib); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sha1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && 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, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_hash_sha1, __pyx_t_2) < 0) __PYX_ERR(0, 786, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":787
 * hash_md5 = make_hash(hashlib.md5)
 * hash_sha1 = make_hash(hashlib.sha1)
 * hash_sha256 = make_hash(hashlib.sha256)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_make_hash); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_hashlib); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_sha256); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 787, __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_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 787, __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_hash_sha256, __pyx_t_2) < 0) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":935
 *     return accum
 * 
 * def DictCursorWrapper(cursor):             # <<<<<<<<<<<<<<
 *     return CursorWrapper(cursor, dict_transform)
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7sweepea_5DictCursorWrapper, NULL, __pyx_n_s_sweepea); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_DictCursorWrapper, __pyx_t_2) < 0) __PYX_ERR(0, 935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":960
 *         return inner
 * 
 * __sentinel__ = object()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sentinel, __pyx_t_2) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":963
 * 
 * 
 * def __status__(flag, return_highwater=False):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a sqlite3_status() call for a particular flag as a property of the
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7sweepea_7__status__, NULL, __pyx_n_s_sweepea); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_status, __pyx_t_2) < 0) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":981
 * 
 * 
 * def __dbstatus__(flag, return_highwater=False, return_current=False):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a sqlite3_dbstatus() call for a particular flag as a property of the
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7sweepea_9__dbstatus__, NULL, __pyx_n_s_sweepea); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_dbstatus, __pyx_t_2) < 0) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":1005
 * 
 * 
 * def __pragma__(name):             # <<<<<<<<<<<<<<
 *     """
 *     Expose a SQLite PRAGMA operation as a property of the Database, with a
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7sweepea_11__pragma__, NULL, __pyx_n_s_sweepea); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pragma_2, __pyx_t_2) < 0) __PYX_ERR(0, 1005, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":1131
 * 
 * 
 * class ConnectionLocal(threading.local):             # <<<<<<<<<<<<<<
 *     """
 *     Thread-local storage for connection state and transaction management.
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_threading); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_local); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1131, __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, 1131, __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, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_ConnectionLocal, __pyx_n_s_ConnectionLocal, (PyObject *) NULL, __pyx_n_s_sweepea, __pyx_kp_s_Thread_local_storage_for_connec); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":1135
 *     Thread-local storage for connection state and transaction management.
 *     """
 *     def __init__(self, **kwargs):             # <<<<<<<<<<<<<<
 *         super(ConnectionLocal, self).__init__(**kwargs)
 *         self.closed = True
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_15ConnectionLocal_1__init__, 0, __pyx_n_s_ConnectionLocal___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 1135, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":1131
 * 
 * 
 * class ConnectionLocal(threading.local):             # <<<<<<<<<<<<<<
 *     """
 *     Thread-local storage for connection state and transaction management.
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_ConnectionLocal, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ConnectionLocal, __pyx_t_4) < 0) __PYX_ERR(0, 1131, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":1530
 *         return Context().parse(query)
 * 
 *     def pragma(self, key, value=__sentinel__):             # <<<<<<<<<<<<<<
 *         """
 *         Issue a PRAGMA query on the current connection. To query the status of
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sentinel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__46 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "sweepea.pyx":1774
 * 
 *     # Pragma queries.
 *     cache_size = __pragma__('cache_size')             # <<<<<<<<<<<<<<
 *     foreign_keys = __pragma__('foreign_keys')
 *     journal_mode = __pragma__('journal_mode')
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pragma_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_cache_size, __pyx_t_1) < 0) __PYX_ERR(0, 1774, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1775
 *     # Pragma queries.
 *     cache_size = __pragma__('cache_size')
 *     foreign_keys = __pragma__('foreign_keys')             # <<<<<<<<<<<<<<
 *     journal_mode = __pragma__('journal_mode')
 *     journal_size_limit = __pragma__('journal_size_limit')
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pragma_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_foreign_keys, __pyx_t_2) < 0) __PYX_ERR(0, 1775, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1776
 *     cache_size = __pragma__('cache_size')
 *     foreign_keys = __pragma__('foreign_keys')
 *     journal_mode = __pragma__('journal_mode')             # <<<<<<<<<<<<<<
 *     journal_size_limit = __pragma__('journal_size_limit')
 *     mmap_size = __pragma__('mmap_size')
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pragma_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__121, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_journal_mode, __pyx_t_1) < 0) __PYX_ERR(0, 1776, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1777
 *     foreign_keys = __pragma__('foreign_keys')
 *     journal_mode = __pragma__('journal_mode')
 *     journal_size_limit = __pragma__('journal_size_limit')             # <<<<<<<<<<<<<<
 *     mmap_size = __pragma__('mmap_size')
 *     page_size = __pragma__('page_size')
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pragma_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__122, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_journal_size_limit, __pyx_t_2) < 0) __PYX_ERR(0, 1777, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1778
 *     journal_mode = __pragma__('journal_mode')
 *     journal_size_limit = __pragma__('journal_size_limit')
 *     mmap_size = __pragma__('mmap_size')             # <<<<<<<<<<<<<<
 *     page_size = __pragma__('page_size')
 *     read_uncommitted = __pragma__('read_uncommitted')
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pragma_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1778, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_mmap_size, __pyx_t_1) < 0) __PYX_ERR(0, 1778, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1779
 *     journal_size_limit = __pragma__('journal_size_limit')
 *     mmap_size = __pragma__('mmap_size')
 *     page_size = __pragma__('page_size')             # <<<<<<<<<<<<<<
 *     read_uncommitted = __pragma__('read_uncommitted')
 *     synchronous = __pragma__('synchronous')
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pragma_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__124, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_page_size, __pyx_t_2) < 0) __PYX_ERR(0, 1779, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1780
 *     mmap_size = __pragma__('mmap_size')
 *     page_size = __pragma__('page_size')
 *     read_uncommitted = __pragma__('read_uncommitted')             # <<<<<<<<<<<<<<
 *     synchronous = __pragma__('synchronous')
 *     wal_autocheckpoint = __pragma__('wal_autocheckpoint')
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pragma_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1780, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_read_uncommitted, __pyx_t_1) < 0) __PYX_ERR(0, 1780, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1781
 *     page_size = __pragma__('page_size')
 *     read_uncommitted = __pragma__('read_uncommitted')
 *     synchronous = __pragma__('synchronous')             # <<<<<<<<<<<<<<
 *     wal_autocheckpoint = __pragma__('wal_autocheckpoint')
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pragma_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_synchronous, __pyx_t_2) < 0) __PYX_ERR(0, 1781, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1782
 *     read_uncommitted = __pragma__('read_uncommitted')
 *     synchronous = __pragma__('synchronous')
 *     wal_autocheckpoint = __pragma__('wal_autocheckpoint')             # <<<<<<<<<<<<<<
 * 
 *     # Status properties.
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pragma_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__127, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_wal_autocheckpoint, __pyx_t_1) < 0) __PYX_ERR(0, 1782, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1785
 * 
 *     # Status properties.
 *     memory_used = __status__(SQLITE_STATUS_MEMORY_USED)             # <<<<<<<<<<<<<<
 *     malloc_size = __status__(SQLITE_STATUS_MALLOC_SIZE, True)
 *     malloc_count = __status__(SQLITE_STATUS_MALLOC_COUNT)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_From_int(SQLITE_STATUS_MEMORY_USED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1785, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1785, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1785, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_memory_used, __pyx_t_1) < 0) __PYX_ERR(0, 1785, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1786
 *     # Status properties.
 *     memory_used = __status__(SQLITE_STATUS_MEMORY_USED)
 *     malloc_size = __status__(SQLITE_STATUS_MALLOC_SIZE, True)             # <<<<<<<<<<<<<<
 *     malloc_count = __status__(SQLITE_STATUS_MALLOC_COUNT)
 *     pagecache_used = __status__(SQLITE_STATUS_PAGECACHE_USED)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(SQLITE_STATUS_MALLOC_SIZE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1786, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1786, __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_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, Py_True);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1786, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_malloc_size, __pyx_t_1) < 0) __PYX_ERR(0, 1786, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1787
 *     memory_used = __status__(SQLITE_STATUS_MEMORY_USED)
 *     malloc_size = __status__(SQLITE_STATUS_MALLOC_SIZE, True)
 *     malloc_count = __status__(SQLITE_STATUS_MALLOC_COUNT)             # <<<<<<<<<<<<<<
 *     pagecache_used = __status__(SQLITE_STATUS_PAGECACHE_USED)
 *     pagecache_overflow = __status__(SQLITE_STATUS_PAGECACHE_OVERFLOW)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(SQLITE_STATUS_MALLOC_COUNT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1787, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1787, __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_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1787, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_malloc_count, __pyx_t_1) < 0) __PYX_ERR(0, 1787, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1788
 *     malloc_size = __status__(SQLITE_STATUS_MALLOC_SIZE, True)
 *     malloc_count = __status__(SQLITE_STATUS_MALLOC_COUNT)
 *     pagecache_used = __status__(SQLITE_STATUS_PAGECACHE_USED)             # <<<<<<<<<<<<<<
 *     pagecache_overflow = __status__(SQLITE_STATUS_PAGECACHE_OVERFLOW)
 *     pagecache_size = __status__(SQLITE_STATUS_PAGECACHE_SIZE, True)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_From_int(SQLITE_STATUS_PAGECACHE_USED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1788, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1788, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_pagecache_used, __pyx_t_1) < 0) __PYX_ERR(0, 1788, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1789
 *     malloc_count = __status__(SQLITE_STATUS_MALLOC_COUNT)
 *     pagecache_used = __status__(SQLITE_STATUS_PAGECACHE_USED)
 *     pagecache_overflow = __status__(SQLITE_STATUS_PAGECACHE_OVERFLOW)             # <<<<<<<<<<<<<<
 *     pagecache_size = __status__(SQLITE_STATUS_PAGECACHE_SIZE, True)
 *     scratch_used = __status__(SQLITE_STATUS_SCRATCH_USED)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(SQLITE_STATUS_PAGECACHE_OVERFLOW); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1789, __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_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1789, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_pagecache_overflow, __pyx_t_1) < 0) __PYX_ERR(0, 1789, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1790
 *     pagecache_used = __status__(SQLITE_STATUS_PAGECACHE_USED)
 *     pagecache_overflow = __status__(SQLITE_STATUS_PAGECACHE_OVERFLOW)
 *     pagecache_size = __status__(SQLITE_STATUS_PAGECACHE_SIZE, True)             # <<<<<<<<<<<<<<
 *     scratch_used = __status__(SQLITE_STATUS_SCRATCH_USED)
 *     scratch_overflow = __status__(SQLITE_STATUS_SCRATCH_OVERFLOW)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(SQLITE_STATUS_PAGECACHE_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1790, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_t_4);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, Py_True);
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1790, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_pagecache_size, __pyx_t_1) < 0) __PYX_ERR(0, 1790, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1791
 *     pagecache_overflow = __status__(SQLITE_STATUS_PAGECACHE_OVERFLOW)
 *     pagecache_size = __status__(SQLITE_STATUS_PAGECACHE_SIZE, True)
 *     scratch_used = __status__(SQLITE_STATUS_SCRATCH_USED)             # <<<<<<<<<<<<<<
 *     scratch_overflow = __status__(SQLITE_STATUS_SCRATCH_OVERFLOW)
 *     scratch_size = __status__(SQLITE_STATUS_SCRATCH_SIZE, True)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_From_int(SQLITE_STATUS_SCRATCH_USED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1791, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1791, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1791, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_scratch_used, __pyx_t_1) < 0) __PYX_ERR(0, 1791, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1792
 *     pagecache_size = __status__(SQLITE_STATUS_PAGECACHE_SIZE, True)
 *     scratch_used = __status__(SQLITE_STATUS_SCRATCH_USED)
 *     scratch_overflow = __status__(SQLITE_STATUS_SCRATCH_OVERFLOW)             # <<<<<<<<<<<<<<
 *     scratch_size = __status__(SQLITE_STATUS_SCRATCH_SIZE, True)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(SQLITE_STATUS_SCRATCH_OVERFLOW); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1792, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1792, __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_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1792, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_scratch_overflow, __pyx_t_1) < 0) __PYX_ERR(0, 1792, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1793
 *     scratch_used = __status__(SQLITE_STATUS_SCRATCH_USED)
 *     scratch_overflow = __status__(SQLITE_STATUS_SCRATCH_OVERFLOW)
 *     scratch_size = __status__(SQLITE_STATUS_SCRATCH_SIZE, True)             # <<<<<<<<<<<<<<
 * 
 *     # Connection status properties.
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_status); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(SQLITE_STATUS_SCRATCH_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_t_4);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, Py_True);
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1793, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_scratch_size, __pyx_t_1) < 0) __PYX_ERR(0, 1793, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1796
 * 
 *     # Connection status properties.
 *     lookaside_used = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_USED)             # <<<<<<<<<<<<<<
 *     lookaside_hit = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_HIT, True)
 *     lookaside_miss = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE, True)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dbstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_From_int(SQLITE_DBSTATUS_LOOKASIDE_USED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1796, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1796, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1796, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_lookaside_used, __pyx_t_1) < 0) __PYX_ERR(0, 1796, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1797
 *     # Connection status properties.
 *     lookaside_used = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_USED)
 *     lookaside_hit = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_HIT, True)             # <<<<<<<<<<<<<<
 *     lookaside_miss = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE, True)
 *     lookaside_miss_full = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL,
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dbstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(SQLITE_DBSTATUS_LOOKASIDE_HIT); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1797, __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_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, Py_True);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1797, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_lookaside_hit, __pyx_t_1) < 0) __PYX_ERR(0, 1797, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1798
 *     lookaside_used = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_USED)
 *     lookaside_hit = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_HIT, True)
 *     lookaside_miss = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE, True)             # <<<<<<<<<<<<<<
 *     lookaside_miss_full = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL,
 *                                        True)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dbstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1798, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_t_4);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, Py_True);
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1798, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_lookaside_miss, __pyx_t_1) < 0) __PYX_ERR(0, 1798, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1799
 *     lookaside_hit = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_HIT, True)
 *     lookaside_miss = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE, True)
 *     lookaside_miss_full = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL,             # <<<<<<<<<<<<<<
 *                                        True)
 *     cache_used = __dbstatus__(SQLITE_DBSTATUS_CACHE_USED, False, True)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dbstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_From_int(SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":1800
 *     lookaside_miss = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE, True)
 *     lookaside_miss_full = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL,
 *                                        True)             # <<<<<<<<<<<<<<
 *     cache_used = __dbstatus__(SQLITE_DBSTATUS_CACHE_USED, False, True)
 *     cache_used_shared = __dbstatus__(SQLITE_DBSTATUS_CACHE_USED_SHARED,
 */
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1799, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_t_5);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, Py_True);
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1799, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_lookaside_miss_full, __pyx_t_1) < 0) __PYX_ERR(0, 1799, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1801
 *     lookaside_miss_full = __dbstatus__(SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL,
 *                                        True)
 *     cache_used = __dbstatus__(SQLITE_DBSTATUS_CACHE_USED, False, True)             # <<<<<<<<<<<<<<
 *     cache_used_shared = __dbstatus__(SQLITE_DBSTATUS_CACHE_USED_SHARED,
 *                                      False, True)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dbstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(SQLITE_DBSTATUS_CACHE_USED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1801, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1801, __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_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, Py_False);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_6, Py_True);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1801, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_cache_used, __pyx_t_1) < 0) __PYX_ERR(0, 1801, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1802
 *                                        True)
 *     cache_used = __dbstatus__(SQLITE_DBSTATUS_CACHE_USED, False, True)
 *     cache_used_shared = __dbstatus__(SQLITE_DBSTATUS_CACHE_USED_SHARED,             # <<<<<<<<<<<<<<
 *                                      False, True)
 *     schema_used = __dbstatus__(SQLITE_DBSTATUS_SCHEMA_USED, False, True)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dbstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(SQLITE_DBSTATUS_CACHE_USED_SHARED); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "sweepea.pyx":1803
 *     cache_used = __dbstatus__(SQLITE_DBSTATUS_CACHE_USED, False, True)
 *     cache_used_shared = __dbstatus__(SQLITE_DBSTATUS_CACHE_USED_SHARED,
 *                                      False, True)             # <<<<<<<<<<<<<<
 *     schema_used = __dbstatus__(SQLITE_DBSTATUS_SCHEMA_USED, False, True)
 *     statement_used = __dbstatus__(SQLITE_DBSTATUS_STMT_USED, False, True)
 */
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_t_4);
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, Py_False);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, Py_True);
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1802, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_cache_used_shared, __pyx_t_1) < 0) __PYX_ERR(0, 1802, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1804
 *     cache_used_shared = __dbstatus__(SQLITE_DBSTATUS_CACHE_USED_SHARED,
 *                                      False, True)
 *     schema_used = __dbstatus__(SQLITE_DBSTATUS_SCHEMA_USED, False, True)             # <<<<<<<<<<<<<<
 *     statement_used = __dbstatus__(SQLITE_DBSTATUS_STMT_USED, False, True)
 *     cache_hit = __dbstatus__(SQLITE_DBSTATUS_CACHE_HIT, False, True)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dbstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_From_int(SQLITE_DBSTATUS_SCHEMA_USED); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_3 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_t_5);
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, Py_False);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, Py_True);
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1804, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_schema_used, __pyx_t_1) < 0) __PYX_ERR(0, 1804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1805
 *                                      False, True)
 *     schema_used = __dbstatus__(SQLITE_DBSTATUS_SCHEMA_USED, False, True)
 *     statement_used = __dbstatus__(SQLITE_DBSTATUS_STMT_USED, False, True)             # <<<<<<<<<<<<<<
 *     cache_hit = __dbstatus__(SQLITE_DBSTATUS_CACHE_HIT, False, True)
 *     cache_miss = __dbstatus__(SQLITE_DBSTATUS_CACHE_MISS, False, True)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dbstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(SQLITE_DBSTATUS_STMT_USED); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1805, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1805, __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_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, Py_False);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_6, Py_True);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1805, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_statement_used, __pyx_t_1) < 0) __PYX_ERR(0, 1805, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1806
 *     schema_used = __dbstatus__(SQLITE_DBSTATUS_SCHEMA_USED, False, True)
 *     statement_used = __dbstatus__(SQLITE_DBSTATUS_STMT_USED, False, True)
 *     cache_hit = __dbstatus__(SQLITE_DBSTATUS_CACHE_HIT, False, True)             # <<<<<<<<<<<<<<
 *     cache_miss = __dbstatus__(SQLITE_DBSTATUS_CACHE_MISS, False, True)
 *     cache_write = __dbstatus__(SQLITE_DBSTATUS_CACHE_WRITE, False, True)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dbstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_From_int(SQLITE_DBSTATUS_CACHE_HIT); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_5 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_t_4);
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, Py_False);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_6, Py_True);
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1806, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_cache_hit, __pyx_t_1) < 0) __PYX_ERR(0, 1806, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1807
 *     statement_used = __dbstatus__(SQLITE_DBSTATUS_STMT_USED, False, True)
 *     cache_hit = __dbstatus__(SQLITE_DBSTATUS_CACHE_HIT, False, True)
 *     cache_miss = __dbstatus__(SQLITE_DBSTATUS_CACHE_MISS, False, True)             # <<<<<<<<<<<<<<
 *     cache_write = __dbstatus__(SQLITE_DBSTATUS_CACHE_WRITE, False, True)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dbstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_From_int(SQLITE_DBSTATUS_CACHE_MISS); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_3 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_t_5);
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, Py_False);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_6, Py_True);
  __pyx_t_5 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1807, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_cache_miss, __pyx_t_1) < 0) __PYX_ERR(0, 1807, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1808
 *     cache_hit = __dbstatus__(SQLITE_DBSTATUS_CACHE_HIT, False, True)
 *     cache_miss = __dbstatus__(SQLITE_DBSTATUS_CACHE_MISS, False, True)
 *     cache_write = __dbstatus__(SQLITE_DBSTATUS_CACHE_WRITE, False, True)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_dbstatus); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_int(SQLITE_DBSTATUS_CACHE_WRITE); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1808, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1808, __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_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_t_3);
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, Py_False);
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_6, Py_True);
  __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1808, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Database->tp_dict, __pyx_n_s_cache_write, __pyx_t_1) < 0) __PYX_ERR(0, 1808, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Database);

  /* "sweepea.pyx":1908
 * 
 * # Query Builder.
 * SCOPE_NORMAL = 0             # <<<<<<<<<<<<<<
 * SCOPE_SOURCE = 1
 * SCOPE_VALUES = 2
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCOPE_NORMAL, __pyx_int_0) < 0) __PYX_ERR(0, 1908, __pyx_L1_error)

  /* "sweepea.pyx":1909
 * # Query Builder.
 * SCOPE_NORMAL = 0
 * SCOPE_SOURCE = 1             # <<<<<<<<<<<<<<
 * SCOPE_VALUES = 2
 * SCOPE_CTE = 3
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCOPE_SOURCE, __pyx_int_1) < 0) __PYX_ERR(0, 1909, __pyx_L1_error)

  /* "sweepea.pyx":1910
 * SCOPE_NORMAL = 0
 * SCOPE_SOURCE = 1
 * SCOPE_VALUES = 2             # <<<<<<<<<<<<<<
 * SCOPE_CTE = 3
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCOPE_VALUES, __pyx_int_2) < 0) __PYX_ERR(0, 1910, __pyx_L1_error)

  /* "sweepea.pyx":1911
 * SCOPE_SOURCE = 1
 * SCOPE_VALUES = 2
 * SCOPE_CTE = 3             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SCOPE_CTE, __pyx_int_3) < 0) __PYX_ERR(0, 1911, __pyx_L1_error)

  /* "sweepea.pyx":1922
 *         int scope
 * 
 *     def __cinit__(self, scope=SCOPE_NORMAL, parentheses=False,             # <<<<<<<<<<<<<<
 *                   subquery=False):
 *         self.scope = scope
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCOPE_NORMAL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_k__48 = __pyx_t_1;
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "sweepea.pyx":1935
 * 
 * 
 * def __scope_context__(int scope):             # <<<<<<<<<<<<<<
 *     @contextmanager
 *     def inner(self, **kwargs):
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sweepea_13__scope_context__, NULL, __pyx_n_s_sweepea); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_scope_context, __pyx_t_1) < 0) __PYX_ERR(0, 1935, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":1976
 *         return self
 * 
 *     scope_normal = __scope_context__(SCOPE_NORMAL)             # <<<<<<<<<<<<<<
 *     scope_source = __scope_context__(SCOPE_SOURCE)
 *     scope_values = __scope_context__(SCOPE_VALUES)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_scope_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCOPE_NORMAL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1976, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1976, __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_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1976, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Context->tp_dict, __pyx_n_s_scope_normal, __pyx_t_1) < 0) __PYX_ERR(0, 1976, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Context);

  /* "sweepea.pyx":1977
 * 
 *     scope_normal = __scope_context__(SCOPE_NORMAL)
 *     scope_source = __scope_context__(SCOPE_SOURCE)             # <<<<<<<<<<<<<<
 *     scope_values = __scope_context__(SCOPE_VALUES)
 *     scope_cte = __scope_context__(SCOPE_CTE)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_scope_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCOPE_SOURCE); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1977, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1977, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Context->tp_dict, __pyx_n_s_scope_source, __pyx_t_1) < 0) __PYX_ERR(0, 1977, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Context);

  /* "sweepea.pyx":1978
 *     scope_normal = __scope_context__(SCOPE_NORMAL)
 *     scope_source = __scope_context__(SCOPE_SOURCE)
 *     scope_values = __scope_context__(SCOPE_VALUES)             # <<<<<<<<<<<<<<
 *     scope_cte = __scope_context__(SCOPE_CTE)
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_scope_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCOPE_VALUES); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1978, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1978, __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_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1978, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Context->tp_dict, __pyx_n_s_scope_values, __pyx_t_1) < 0) __PYX_ERR(0, 1978, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Context);

  /* "sweepea.pyx":1979
 *     scope_source = __scope_context__(SCOPE_SOURCE)
 *     scope_values = __scope_context__(SCOPE_VALUES)
 *     scope_cte = __scope_context__(SCOPE_CTE)             # <<<<<<<<<<<<<<
 * 
 *     def __enter__(self):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_scope_context); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_SCOPE_CTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1979, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1979, __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_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1979, __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;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_7sweepea_Context->tp_dict, __pyx_n_s_scope_cte, __pyx_t_1) < 0) __PYX_ERR(0, 1979, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_7sweepea_Context);

  /* "sweepea.pyx":2061
 * 
 * 
 * class Node(object):             # <<<<<<<<<<<<<<
 *     def clone(self):
 *         obj = self.__class__.__new__(self.__class__)
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2061, __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, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Node, __pyx_n_s_Node, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2062
 * 
 * class Node(object):
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         obj = self.__class__.__new__(self.__class__)
 *         obj.__dict__ = self.__dict__.copy()
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_4Node_1clone, 0, __pyx_n_s_Node_clone, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_clone, __pyx_t_4) < 0) __PYX_ERR(0, 2062, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2068
 * 
 *     @staticmethod
 *     def copy(method):             # <<<<<<<<<<<<<<
 *         def inner(self, *args, **kwargs):
 *             clone = self.clone()
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_4Node_3copy, __Pyx_CYFUNCTION_STATICMETHOD, __pyx_n_s_Node_copy, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "sweepea.pyx":2067
 *         return obj
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def copy(method):
 *         def inner(self, *args, **kwargs):
 */
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_staticmethod, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_copy, __pyx_t_4) < 0) __PYX_ERR(0, 2068, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2061
 * 
 * 
 * class Node(object):             # <<<<<<<<<<<<<<
 *     def clone(self):
 *         obj = self.__class__.__new__(self.__class__)
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Node, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Node, __pyx_t_4) < 0) __PYX_ERR(0, 2061, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2076
 * 
 * 
 * class Source(Node):             # <<<<<<<<<<<<<<
 *     c = _DynamicColumn()
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2076, __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, 2076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Source, __pyx_n_s_Source, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2077
 * 
 * class Source(Node):
 *     c = _DynamicColumn()             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, alias=None):
 */
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_7sweepea__DynamicColumn), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_c, __pyx_t_4) < 0) __PYX_ERR(0, 2077, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2079
 *     c = _DynamicColumn()
 * 
 *     def __init__(self, alias=None):             # <<<<<<<<<<<<<<
 *         super(Source, self).__init__()
 *         self._alias = alias
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Source_1__init__, 0, __pyx_n_s_Source___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__135)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__136);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2079, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2083
 *         self._alias = alias
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def alias(self, name=None):
 *         self._alias = name
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "sweepea.pyx":2084
 * 
 *     @Node.copy
 *     def alias(self, name=None):             # <<<<<<<<<<<<<<
 *         self._alias = name
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Source_3alias, 0, __pyx_n_s_Source_alias, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__139);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2083, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2083, __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_3);
    PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2083, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_alias, __pyx_t_4) < 0) __PYX_ERR(0, 2084, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2087
 *         self._alias = name
 * 
 *     def select(self, *selection):             # <<<<<<<<<<<<<<
 *         return Select((self,), selection)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Source_5select, 0, __pyx_n_s_Source_select, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__141)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2087, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_select, __pyx_t_4) < 0) __PYX_ERR(0, 2087, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2090
 *         return Select((self,), selection)
 * 
 *     def join(self, other, join_type='INNER', on=None):             # <<<<<<<<<<<<<<
 *         return Join(self, other, join_type, on)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Source_7join, 0, __pyx_n_s_Source_join, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__143)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__144);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_join, __pyx_t_4) < 0) __PYX_ERR(0, 2090, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2093
 *         return Join(self, other, join_type, on)
 * 
 *     def left_outer_join(self, other, on=None):             # <<<<<<<<<<<<<<
 *         return self.join(other, 'LEFT OUTER', on)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Source_9left_outer_join, 0, __pyx_n_s_Source_left_outer_join, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2093, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__147);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_left_outer_join, __pyx_t_4) < 0) __PYX_ERR(0, 2093, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2096
 *         return self.join(other, 'LEFT OUTER', on)
 * 
 *     def apply_alias(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if ctx.scope == SCOPE_SOURCE and self._alias:
 *             ctx.literal(' AS ').sql(Entity(self._alias))
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Source_11apply_alias, 0, __pyx_n_s_Source_apply_alias, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__149)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_apply_alias, __pyx_t_4) < 0) __PYX_ERR(0, 2096, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2076
 * 
 * 
 * class Source(Node):             # <<<<<<<<<<<<<<
 *     c = _DynamicColumn()
 * 
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Source, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Source, __pyx_t_4) < 0) __PYX_ERR(0, 2076, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2102
 * 
 * 
 * class Table(Source):             # <<<<<<<<<<<<<<
 *     def __init__(self, name, columns=None, schema=None, alias=None):
 *         self.name = name
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Source); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2102, __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, 2102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Table, __pyx_n_s_Table, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2103
 * 
 * class Table(Source):
 *     def __init__(self, name, columns=None, schema=None, alias=None):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self._columns = columns
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Table_1__init__, 0, __pyx_n_s_Table___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__151)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2103, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__152);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2103, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2115
 *                 setattr(self, column, Column(self, column))
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         return Table(self.name, self._columns, schema=self._schema,
 *                      alias=self._alias)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Table_3clone, 0, __pyx_n_s_Table_clone, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_clone, __pyx_t_4) < 0) __PYX_ERR(0, 2115, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2119
 *                      alias=self._alias)
 * 
 *     def select(self, *selection):             # <<<<<<<<<<<<<<
 *         if not selection and self._columns:
 *             selection = [Column(self, column) for column in self._columns]
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Table_5select, 0, __pyx_n_s_Table_select, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_select, __pyx_t_4) < 0) __PYX_ERR(0, 2119, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2124
 *         return Select((self,), selection)
 * 
 *     def insert(self, data, **kwargs):             # <<<<<<<<<<<<<<
 *         return Insert(self, data, **kwargs)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Table_7insert, 0, __pyx_n_s_Table_insert, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_insert, __pyx_t_4) < 0) __PYX_ERR(0, 2124, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2127
 *         return Insert(self, data, **kwargs)
 * 
 *     def update(self, data):             # <<<<<<<<<<<<<<
 *         return Update(self, data)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Table_9update, 0, __pyx_n_s_Table_update, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_update, __pyx_t_4) < 0) __PYX_ERR(0, 2127, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2130
 *         return Update(self, data)
 * 
 *     def delete(self):             # <<<<<<<<<<<<<<
 *         return Delete(self)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Table_11delete, 0, __pyx_n_s_Table_delete, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_delete, __pyx_t_4) < 0) __PYX_ERR(0, 2130, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2133
 *         return Delete(self)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if ctx.scope == SCOPE_SOURCE:
 *             ctx.sql(Entity(*self._path))
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Table_13__sql__, 0, __pyx_n_s_Table___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2133, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2102
 * 
 * 
 * class Table(Source):             # <<<<<<<<<<<<<<
 *     def __init__(self, name, columns=None, schema=None, alias=None):
 *         self.name = name
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Table, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Table, __pyx_t_4) < 0) __PYX_ERR(0, 2102, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2146
 * 
 * 
 * class Join(Source):             # <<<<<<<<<<<<<<
 *     def __init__(self, lhs, rhs, join_type='INNER', on=None):
 *         super(Join, self).__init__()
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Source); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2146, __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, 2146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Join, __pyx_n_s_Join, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2147
 * 
 * class Join(Source):
 *     def __init__(self, lhs, rhs, join_type='INNER', on=None):             # <<<<<<<<<<<<<<
 *         super(Join, self).__init__()
 *         self._lhs = lhs
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_4Join_1__init__, 0, __pyx_n_s_Join___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__167);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2154
 *         self._on = on
 * 
 *     def on(self, predicate):             # <<<<<<<<<<<<<<
 *         self._on = predicate
 *         return self
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_4Join_3on, 0, __pyx_n_s_Join_on, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__169)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_on, __pyx_t_4) < 0) __PYX_ERR(0, 2154, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2158
 *         return self
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         (ctx
 *          .sql(self._lhs)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_4Join_5__sql__, 0, __pyx_n_s_Join___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__171)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2158, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2146
 * 
 * 
 * class Join(Source):             # <<<<<<<<<<<<<<
 *     def __init__(self, lhs, rhs, join_type='INNER', on=None):
 *         super(Join, self).__init__()
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Join, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Join, __pyx_t_4) < 0) __PYX_ERR(0, 2146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2168
 * 
 * 
 * class CTE(Source):             # <<<<<<<<<<<<<<
 *     def __init__(self, name, query, recursive=False, columns=None):
 *         self._alias = name
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Source); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2168, __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, 2168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_CTE, __pyx_n_s_CTE, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2169
 * 
 * class CTE(Source):
 *     def __init__(self, name, query, recursive=False, columns=None):             # <<<<<<<<<<<<<<
 *         self._alias = name
 *         self._nested_cte_list = query._cte_list
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_3CTE_1__init__, 0, __pyx_n_s_CTE___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__173)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__174);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2169, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2178
 *         super(CTE, self).__init__(alias=name)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.sql(Entity(self._alias))
 *         if ctx.scope == SCOPE_CTE:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_3CTE_3__sql__, 0, __pyx_n_s_CTE___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2168
 * 
 * 
 * class CTE(Source):             # <<<<<<<<<<<<<<
 *     def __init__(self, name, query, recursive=False, columns=None):
 *         self._alias = name
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_CTE, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2168, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CTE, __pyx_t_4) < 0) __PYX_ERR(0, 2168, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2190
 * 
 * 
 * class EntityBase(Node):             # <<<<<<<<<<<<<<
 *     def alias(self, name):
 *         return Alias(self, name)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2190, __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, 2190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_EntityBase, __pyx_n_s_EntityBase, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2191
 * 
 * class EntityBase(Node):
 *     def alias(self, name):             # <<<<<<<<<<<<<<
 *         return Alias(self, name)
 *     def __inv__(self):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10EntityBase_1alias, 0, __pyx_n_s_EntityBase_alias, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_alias, __pyx_t_4) < 0) __PYX_ERR(0, 2191, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2193
 *     def alias(self, name):
 *         return Alias(self, name)
 *     def __inv__(self):             # <<<<<<<<<<<<<<
 *         return Negated(self)
 *     def __eq__(self, other):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10EntityBase_3__inv__, 0, __pyx_n_s_EntityBase___inv, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_inv_2, __pyx_t_4) < 0) __PYX_ERR(0, 2193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2195
 *     def __inv__(self):
 *         return Negated(self)
 *     def __eq__(self, other):             # <<<<<<<<<<<<<<
 *         return Expression(self, '=', other)
 *     def __ne__(self, other):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10EntityBase_5__eq__, 0, __pyx_n_s_EntityBase___eq, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_eq, __pyx_t_4) < 0) __PYX_ERR(0, 2195, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2197
 *     def __eq__(self, other):
 *         return Expression(self, '=', other)
 *     def __ne__(self, other):             # <<<<<<<<<<<<<<
 *         return Expression(self, '!=', other)
 *     def __neg__(self):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10EntityBase_7__ne__, 0, __pyx_n_s_EntityBase___ne, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_ne, __pyx_t_4) < 0) __PYX_ERR(0, 2197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2199
 *     def __ne__(self, other):
 *         return Expression(self, '!=', other)
 *     def __neg__(self):             # <<<<<<<<<<<<<<
 *         return self.desc()
 *     def __pos__(self):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10EntityBase_9__neg__, 0, __pyx_n_s_EntityBase___neg, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_neg, __pyx_t_4) < 0) __PYX_ERR(0, 2199, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2201
 *     def __neg__(self):
 *         return self.desc()
 *     def __pos__(self):             # <<<<<<<<<<<<<<
 *         return self.asc()
 *     def __e__(op, inv=False):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10EntityBase_11__pos__, 0, __pyx_n_s_EntityBase___pos, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_pos, __pyx_t_4) < 0) __PYX_ERR(0, 2201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2203
 *     def __pos__(self):
 *         return self.asc()
 *     def __e__(op, inv=False):             # <<<<<<<<<<<<<<
 *         def inner(self, rhs):
 *             if inv:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10EntityBase_13__e__, 0, __pyx_n_s_EntityBase___e, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__191);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_e, __pyx_t_4) < 0) __PYX_ERR(0, 2203, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2209
 *             return Expression(self, op, rhs)
 *         return inner
 *     __and__ = __e__('AND')             # <<<<<<<<<<<<<<
 *     __or__ = __e__('OR')
 *     __add__ = __e__('+')
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__192, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_and_2, __pyx_t_7) < 0) __PYX_ERR(0, 2209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2210
 *         return inner
 *     __and__ = __e__('AND')
 *     __or__ = __e__('OR')             # <<<<<<<<<<<<<<
 *     __add__ = __e__('+')
 *     __sub__ = __e__('-')
 */
  __pyx_t_7 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_7)) {
    PyErr_Clear();
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__193, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_or, __pyx_t_4) < 0) __PYX_ERR(0, 2210, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2211
 *     __and__ = __e__('AND')
 *     __or__ = __e__('OR')
 *     __add__ = __e__('+')             # <<<<<<<<<<<<<<
 *     __sub__ = __e__('-')
 *     __mul__ = __e__('*')
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__195, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2211, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_add, __pyx_t_7) < 0) __PYX_ERR(0, 2211, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2212
 *     __or__ = __e__('OR')
 *     __add__ = __e__('+')
 *     __sub__ = __e__('-')             # <<<<<<<<<<<<<<
 *     __mul__ = __e__('*')
 *     __div__ = __e__('/')
 */
  __pyx_t_7 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_7)) {
    PyErr_Clear();
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__197, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sub, __pyx_t_4) < 0) __PYX_ERR(0, 2212, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2213
 *     __add__ = __e__('+')
 *     __sub__ = __e__('-')
 *     __mul__ = __e__('*')             # <<<<<<<<<<<<<<
 *     __div__ = __e__('/')
 *     __rand__ = __e__('AND', True)
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__199, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2213, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_mul, __pyx_t_7) < 0) __PYX_ERR(0, 2213, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2214
 *     __sub__ = __e__('-')
 *     __mul__ = __e__('*')
 *     __div__ = __e__('/')             # <<<<<<<<<<<<<<
 *     __rand__ = __e__('AND', True)
 *     __ror__ = __e__('OR', True)
 */
  __pyx_t_7 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_7)) {
    PyErr_Clear();
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__201, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_div, __pyx_t_4) < 0) __PYX_ERR(0, 2214, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2215
 *     __mul__ = __e__('*')
 *     __div__ = __e__('/')
 *     __rand__ = __e__('AND', True)             # <<<<<<<<<<<<<<
 *     __ror__ = __e__('OR', True)
 *     __radd__ = __e__('+', True)
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __pyx_pf_7sweepea_10EntityBase_12__e__(__pyx_t_4, __pyx_n_s_AND, Py_True); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_rand, __pyx_t_7) < 0) __PYX_ERR(0, 2215, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2216
 *     __div__ = __e__('/')
 *     __rand__ = __e__('AND', True)
 *     __ror__ = __e__('OR', True)             # <<<<<<<<<<<<<<
 *     __radd__ = __e__('+', True)
 *     __rsub__ = __e__('-', True)
 */
  __pyx_t_7 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_7)) {
    PyErr_Clear();
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __pyx_pf_7sweepea_10EntityBase_12__e__(__pyx_t_7, __pyx_n_s_OR, Py_True); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_ror, __pyx_t_4) < 0) __PYX_ERR(0, 2216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2217
 *     __rand__ = __e__('AND', True)
 *     __ror__ = __e__('OR', True)
 *     __radd__ = __e__('+', True)             # <<<<<<<<<<<<<<
 *     __rsub__ = __e__('-', True)
 *     __rmul__ = __e__('*', True)
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __pyx_pf_7sweepea_10EntityBase_12__e__(__pyx_t_4, __pyx_kp_s__194, Py_True); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2217, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_radd, __pyx_t_7) < 0) __PYX_ERR(0, 2217, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2218
 *     __ror__ = __e__('OR', True)
 *     __radd__ = __e__('+', True)
 *     __rsub__ = __e__('-', True)             # <<<<<<<<<<<<<<
 *     __rmul__ = __e__('*', True)
 *     __rdiv__ = __e__('/', True)
 */
  __pyx_t_7 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_7)) {
    PyErr_Clear();
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __pyx_pf_7sweepea_10EntityBase_12__e__(__pyx_t_7, __pyx_kp_s__196, Py_True); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_rsub, __pyx_t_4) < 0) __PYX_ERR(0, 2218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2219
 *     __radd__ = __e__('+', True)
 *     __rsub__ = __e__('-', True)
 *     __rmul__ = __e__('*', True)             # <<<<<<<<<<<<<<
 *     __rdiv__ = __e__('/', True)
 *     __lt__ = __e__('<')
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __pyx_pf_7sweepea_10EntityBase_12__e__(__pyx_t_4, __pyx_kp_s__198, Py_True); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2219, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_rmul, __pyx_t_7) < 0) __PYX_ERR(0, 2219, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2220
 *     __rsub__ = __e__('-', True)
 *     __rmul__ = __e__('*', True)
 *     __rdiv__ = __e__('/', True)             # <<<<<<<<<<<<<<
 *     __lt__ = __e__('<')
 *     __gt__ = __e__('>')
 */
  __pyx_t_7 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_7)) {
    PyErr_Clear();
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __pyx_pf_7sweepea_10EntityBase_12__e__(__pyx_t_7, __pyx_kp_s__200, Py_True); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_rdiv, __pyx_t_4) < 0) __PYX_ERR(0, 2220, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2221
 *     __rmul__ = __e__('*', True)
 *     __rdiv__ = __e__('/', True)
 *     __lt__ = __e__('<')             # <<<<<<<<<<<<<<
 *     __gt__ = __e__('>')
 *     __le__ = __e__('<=')
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__203, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_lt, __pyx_t_7) < 0) __PYX_ERR(0, 2221, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2222
 *     __rdiv__ = __e__('/', True)
 *     __lt__ = __e__('<')
 *     __gt__ = __e__('>')             # <<<<<<<<<<<<<<
 *     __le__ = __e__('<=')
 *     __ge__ = __e__('>=')
 */
  __pyx_t_7 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_7)) {
    PyErr_Clear();
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__205, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_gt, __pyx_t_4) < 0) __PYX_ERR(0, 2222, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2223
 *     __lt__ = __e__('<')
 *     __gt__ = __e__('>')
 *     __le__ = __e__('<=')             # <<<<<<<<<<<<<<
 *     __ge__ = __e__('>=')
 *     __lshift__ = __e__('IN')
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__207, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_le, __pyx_t_7) < 0) __PYX_ERR(0, 2223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2224
 *     __gt__ = __e__('>')
 *     __le__ = __e__('<=')
 *     __ge__ = __e__('>=')             # <<<<<<<<<<<<<<
 *     __lshift__ = __e__('IN')
 *     __rshift__ = __e__('IS')
 */
  __pyx_t_7 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_7)) {
    PyErr_Clear();
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__209, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_ge, __pyx_t_4) < 0) __PYX_ERR(0, 2224, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2225
 *     __le__ = __e__('<=')
 *     __ge__ = __e__('>=')
 *     __lshift__ = __e__('IN')             # <<<<<<<<<<<<<<
 *     __rshift__ = __e__('IS')
 *     __mod__ = __e__('LIKE')
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__210, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_lshift, __pyx_t_7) < 0) __PYX_ERR(0, 2225, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2226
 *     __ge__ = __e__('>=')
 *     __lshift__ = __e__('IN')
 *     __rshift__ = __e__('IS')             # <<<<<<<<<<<<<<
 *     __mod__ = __e__('LIKE')
 *     __pow__ = __e__('GLOB')
 */
  __pyx_t_7 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_7)) {
    PyErr_Clear();
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__211, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2226, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_rshift, __pyx_t_4) < 0) __PYX_ERR(0, 2226, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2227
 *     __lshift__ = __e__('IN')
 *     __rshift__ = __e__('IS')
 *     __mod__ = __e__('LIKE')             # <<<<<<<<<<<<<<
 *     __pow__ = __e__('GLOB')
 *     in_ = __e__('IN')
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__212, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_mod, __pyx_t_7) < 0) __PYX_ERR(0, 2227, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2228
 *     __rshift__ = __e__('IS')
 *     __mod__ = __e__('LIKE')
 *     __pow__ = __e__('GLOB')             # <<<<<<<<<<<<<<
 *     in_ = __e__('IN')
 *     not_in = __e__('NOT IN')
 */
  __pyx_t_7 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_7)) {
    PyErr_Clear();
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__213, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_pow, __pyx_t_4) < 0) __PYX_ERR(0, 2228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2229
 *     __mod__ = __e__('LIKE')
 *     __pow__ = __e__('GLOB')
 *     in_ = __e__('IN')             # <<<<<<<<<<<<<<
 *     not_in = __e__('NOT IN')
 *     def is_null(self, is_null=True):
 */
  __pyx_t_4 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_4)) {
    PyErr_Clear();
    __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__214, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2229, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_in, __pyx_t_7) < 0) __PYX_ERR(0, 2229, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2230
 *     __pow__ = __e__('GLOB')
 *     in_ = __e__('IN')
 *     not_in = __e__('NOT IN')             # <<<<<<<<<<<<<<
 *     def is_null(self, is_null=True):
 *         return Expression(self, ('IS' if is_null else 'IS NOT'), None)
 */
  __pyx_t_7 = PyObject_GetItem(__pyx_t_5, __pyx_n_s_e);
  if (unlikely(!__pyx_t_7)) {
    PyErr_Clear();
    __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_e);
  }
  if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_tuple__215, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_not_in, __pyx_t_4) < 0) __PYX_ERR(0, 2230, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2231
 *     in_ = __e__('IN')
 *     not_in = __e__('NOT IN')
 *     def is_null(self, is_null=True):             # <<<<<<<<<<<<<<
 *         return Expression(self, ('IS' if is_null else 'IS NOT'), None)
 *     def between(self, lo, hi):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10EntityBase_15is_null, 0, __pyx_n_s_EntityBase_is_null, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__217)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__218);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_is_null, __pyx_t_4) < 0) __PYX_ERR(0, 2231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2233
 *     def is_null(self, is_null=True):
 *         return Expression(self, ('IS' if is_null else 'IS NOT'), None)
 *     def between(self, lo, hi):             # <<<<<<<<<<<<<<
 *         return Expression(self, 'BETWEEN', Expression(lo, 'AND', hi, True))
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10EntityBase_17between, 0, __pyx_n_s_EntityBase_between, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__220)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_between, __pyx_t_4) < 0) __PYX_ERR(0, 2233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2236
 *         return Expression(self, 'BETWEEN', Expression(lo, 'AND', hi, True))
 * 
 *     def asc(self):             # <<<<<<<<<<<<<<
 *         return Asc(self)
 *     def desc(self):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10EntityBase_19asc, 0, __pyx_n_s_EntityBase_asc, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__222)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_asc, __pyx_t_4) < 0) __PYX_ERR(0, 2236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2238
 *     def asc(self):
 *         return Asc(self)
 *     def desc(self):             # <<<<<<<<<<<<<<
 *         return Desc(self)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10EntityBase_21desc, 0, __pyx_n_s_EntityBase_desc, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__224)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_desc, __pyx_t_4) < 0) __PYX_ERR(0, 2238, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2190
 * 
 * 
 * class EntityBase(Node):             # <<<<<<<<<<<<<<
 *     def alias(self, name):
 *         return Alias(self, name)
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_EntityBase, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EntityBase, __pyx_t_4) < 0) __PYX_ERR(0, 2190, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2242
 * 
 * 
 * class Value(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, value):
 *         self.value = value
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntityBase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2242, __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, 2242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Value, __pyx_n_s_Value, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2243
 * 
 * class Value(EntityBase):
 *     def __init__(self, value):             # <<<<<<<<<<<<<<
 *         self.value = value
 *         self.multi = isinstance(self.value, (list, tuple))
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Value_1__init__, 0, __pyx_n_s_Value___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__226)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2243, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2254
 *                     self.bind_values.append(Value(item))
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self.multi:
 *             return ctx.sql(EnclosedList(self.bind_values))
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Value_3__sql__, 0, __pyx_n_s_Value___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__228)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2254, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2242
 * 
 * 
 * class Value(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, value):
 *         self.value = value
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Value, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Value, __pyx_t_4) < 0) __PYX_ERR(0, 2242, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2261
 * 
 * 
 * class Column(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, table, name):
 *         self.table = table
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntityBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2261, __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, 2261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Column, __pyx_n_s_Column, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2262
 * 
 * class Column(EntityBase):
 *     def __init__(self, table, name):             # <<<<<<<<<<<<<<
 *         self.table = table
 *         self.name = name
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Column_1__init__, 0, __pyx_n_s_Column___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__230)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2266
 *         self.name = name
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if ctx.scope == SCOPE_VALUES:
 *             return ctx.sql(Entity(self.name))
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Column_3__sql__, 0, __pyx_n_s_Column___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__232)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2261
 * 
 * 
 * class Column(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, table, name):
 *         self.table = table
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Column, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Column, __pyx_t_4) < 0) __PYX_ERR(0, 2261, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2274
 * 
 * 
 * class Expression(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, lhs, op, rhs, is_flat=False):
 *         if not isinstance(lhs, Node):
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntityBase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2274, __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, 2274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Expression, __pyx_n_s_Expression, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2275
 * 
 * class Expression(EntityBase):
 *     def __init__(self, lhs, op, rhs, is_flat=False):             # <<<<<<<<<<<<<<
 *         if not isinstance(lhs, Node):
 *             lhs = Value(lhs)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10Expression_1__init__, 0, __pyx_n_s_Expression___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__234)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__235);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2275, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2285
 *         self._is_flat = is_flat
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         with ctx(parentheses=not self._is_flat):
 *             return (ctx
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10Expression_3__sql__, 0, __pyx_n_s_Expression___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__237)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2285, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2274
 * 
 * 
 * class Expression(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, lhs, op, rhs, is_flat=False):
 *         if not isinstance(lhs, Node):
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Expression, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Expression, __pyx_t_4) < 0) __PYX_ERR(0, 2274, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2293
 * 
 * 
 * class EntityWrapper(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, entity, *args, **kwargs):
 *         self.entity = entity
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntityBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2293, __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, 2293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_EntityWrapper, __pyx_n_s_EntityWrapper, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2294
 * 
 * class EntityWrapper(EntityBase):
 *     def __init__(self, entity, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         self.entity = entity
 *         super(EntityWrapper, self).__init__(*args, **kwargs)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_13EntityWrapper_1__init__, 0, __pyx_n_s_EntityWrapper___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__239)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2294, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2293
 * 
 * 
 * class EntityWrapper(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, entity, *args, **kwargs):
 *         self.entity = entity
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_EntityWrapper, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EntityWrapper, __pyx_t_4) < 0) __PYX_ERR(0, 2293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2299
 * 
 * 
 * class Alias(EntityWrapper):             # <<<<<<<<<<<<<<
 *     def __init__(self, entity, name):
 *         super(Alias, self).__init__(entity)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntityWrapper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2299, __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, 2299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Alias, __pyx_n_s_Alias, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2300
 * 
 * class Alias(EntityWrapper):
 *     def __init__(self, entity, name):             # <<<<<<<<<<<<<<
 *         super(Alias, self).__init__(entity)
 *         self.name = name
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Alias_1__init__, 0, __pyx_n_s_Alias___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__241)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2300, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2304
 *         self.name = name
 * 
 *     def alias(self, name):             # <<<<<<<<<<<<<<
 *         if not name:
 *             return self.entity
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Alias_3alias, 0, __pyx_n_s_Alias_alias, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__243)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_alias, __pyx_t_4) < 0) __PYX_ERR(0, 2304, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2310
 *         return self
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return ctx.sql(self.entity).literal(' AS "%s"' % self.name)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Alias_5__sql__, 0, __pyx_n_s_Alias___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__245)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2310, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2310, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2299
 * 
 * 
 * class Alias(EntityWrapper):             # <<<<<<<<<<<<<<
 *     def __init__(self, entity, name):
 *         super(Alias, self).__init__(entity)
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Alias, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Alias, __pyx_t_4) < 0) __PYX_ERR(0, 2299, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2314
 * 
 * 
 * class Negated(EntityWrapper):             # <<<<<<<<<<<<<<
 *     def __invert__(self):
 *         return self.entity
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntityWrapper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2314, __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, 2314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Negated, __pyx_n_s_Negated, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2315
 * 
 * class Negated(EntityWrapper):
 *     def __invert__(self):             # <<<<<<<<<<<<<<
 *         return self.entity
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_7Negated_1__invert__, 0, __pyx_n_s_Negated___invert, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__247)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_invert, __pyx_t_4) < 0) __PYX_ERR(0, 2315, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2318
 *         return self.entity
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return ctx.literal(' NOT ').sql(self.entity)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_7Negated_3__sql__, 0, __pyx_n_s_Negated___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__249)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2314
 * 
 * 
 * class Negated(EntityWrapper):             # <<<<<<<<<<<<<<
 *     def __invert__(self):
 *         return self.entity
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Negated, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2314, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Negated, __pyx_t_4) < 0) __PYX_ERR(0, 2314, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2322
 * 
 * 
 * class Cast(EntityWrapper):             # <<<<<<<<<<<<<<
 *     def __init__(self, entity, cast):
 *         super(Cast, self).__init__(entity)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntityWrapper); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2322, __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, 2322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Cast, __pyx_n_s_Cast, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2323
 * 
 * class Cast(EntityWrapper):
 *     def __init__(self, entity, cast):             # <<<<<<<<<<<<<<
 *         super(Cast, self).__init__(entity)
 *         self.cast = cast
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_4Cast_1__init__, 0, __pyx_n_s_Cast___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__251)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2323, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2327
 *         self.cast = cast
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return (ctx
 *                 .literal('CAST(')
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_4Cast_3__sql__, 0, __pyx_n_s_Cast___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__253)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2327, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2322
 * 
 * 
 * class Cast(EntityWrapper):             # <<<<<<<<<<<<<<
 *     def __init__(self, entity, cast):
 *         super(Cast, self).__init__(entity)
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Cast, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Cast, __pyx_t_4) < 0) __PYX_ERR(0, 2322, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2334
 * 
 * 
 * class Ordering(EntityWrapper):             # <<<<<<<<<<<<<<
 *     def __init__(self, entity, direction, collation=None, nulls=None):
 *         super(Ordering, self).__init__(entity)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntityWrapper); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2334, __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, 2334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Ordering, __pyx_n_s_Ordering, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2335
 * 
 * class Ordering(EntityWrapper):
 *     def __init__(self, entity, direction, collation=None, nulls=None):             # <<<<<<<<<<<<<<
 *         super(Ordering, self).__init__(entity)
 *         self.direction = direction
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_8Ordering_1__init__, 0, __pyx_n_s_Ordering___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__255)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__256);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2335, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2341
 *         self.nulls = nulls
 * 
 *     def collate(self, collation=None):             # <<<<<<<<<<<<<<
 *         return Ordering(self.entity, self.direction, collation, self.nulls)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_8Ordering_3collate, 0, __pyx_n_s_Ordering_collate, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__258)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__259);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_collate, __pyx_t_4) < 0) __PYX_ERR(0, 2341, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2344
 *         return Ordering(self.entity, self.direction, collation, self.nulls)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.sql(self.entity).literal(' %s' % self.direction)
 *         if self.collation:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_8Ordering_5__sql__, 0, __pyx_n_s_Ordering___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__261)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2334
 * 
 * 
 * class Ordering(EntityWrapper):             # <<<<<<<<<<<<<<
 *     def __init__(self, entity, direction, collation=None, nulls=None):
 *         super(Ordering, self).__init__(entity)
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Ordering, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Ordering, __pyx_t_4) < 0) __PYX_ERR(0, 2334, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2353
 * 
 * 
 * def Asc(entity, collation=None, nulls=None):             # <<<<<<<<<<<<<<
 *     return Ordering(entity, 'ASC', collation, nulls)
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7sweepea_15Asc, NULL, __pyx_n_s_sweepea); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Asc, __pyx_t_2) < 0) __PYX_ERR(0, 2353, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2357
 * 
 * 
 * def Desc(entity, collation=None, nulls=None):             # <<<<<<<<<<<<<<
 *     return Ordering(entity, 'DESC', collation, nulls)
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7sweepea_17Desc, NULL, __pyx_n_s_sweepea); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Desc, __pyx_t_2) < 0) __PYX_ERR(0, 2357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2361
 * 
 * 
 * class Entity(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, *path):
 *         self._path = filter(None, path)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntityBase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2361, __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, 2361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Entity, __pyx_n_s_Entity, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2362
 * 
 * class Entity(EntityBase):
 *     def __init__(self, *path):             # <<<<<<<<<<<<<<
 *         self._path = filter(None, path)
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Entity_1__init__, 0, __pyx_n_s_Entity___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__267)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2366
 *         self._quoted = '.'.join('"%s"' % part for part in self._path)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return ctx.literal(self._quoted)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Entity_3__sql__, 0, __pyx_n_s_Entity___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__269)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2361
 * 
 * 
 * class Entity(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, *path):
 *         self._path = filter(None, path)
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Entity, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Entity, __pyx_t_4) < 0) __PYX_ERR(0, 2361, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2370
 * 
 * 
 * class SQL(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, sql, params=None):
 *         self.sql = sql
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntityBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2370, __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, 2370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_SQL, __pyx_n_s_SQL, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2371
 * 
 * class SQL(EntityBase):
 *     def __init__(self, sql, params=None):             # <<<<<<<<<<<<<<
 *         self.sql = sql
 *         self.params = params
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_3SQL_1__init__, 0, __pyx_n_s_SQL___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__271)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__272);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2375
 *         self.params = params
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.literal(self.sql)
 *         if self.params:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_3SQL_3__sql__, 0, __pyx_n_s_SQL___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__274)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2375, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2370
 * 
 * 
 * class SQL(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, sql, params=None):
 *         self.sql = sql
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SQL, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SQL, __pyx_t_4) < 0) __PYX_ERR(0, 2370, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2386
 * 
 * 
 * def Check(constraint):             # <<<<<<<<<<<<<<
 *     return SQL('CHECK (%s)' % constraint)
 * 
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_7sweepea_19Check, NULL, __pyx_n_s_sweepea); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Check, __pyx_t_2) < 0) __PYX_ERR(0, 2386, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2390
 * 
 * 
 * class Function(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, name, arguments):
 *         self.name = name
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_EntityBase); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2390, __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, 2390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_Function, __pyx_n_s_Function, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2391
 * 
 * class Function(EntityBase):
 *     def __init__(self, name, arguments):             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arguments = arguments
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_8Function_1__init__, 0, __pyx_n_s_Function___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__278)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2391, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2395
 *         self.arguments = arguments
 * 
 *     def __getattr__(self, attr):             # <<<<<<<<<<<<<<
 *         def decorator(*args):
 *             return Function(attr, args)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_8Function_3__getattr__, 0, __pyx_n_s_Function___getattr, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__280)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_getattr, __pyx_t_4) < 0) __PYX_ERR(0, 2395, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2400
 *         return decorator
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         ctx.literal(self.name)
 *         if not len(self.arguments):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_8Function_5__sql__, 0, __pyx_n_s_Function___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__282)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2400, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2390
 * 
 * 
 * class Function(EntityBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, name, arguments):
 *         self.name = name
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Function, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Function, __pyx_t_4) < 0) __PYX_ERR(0, 2390, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2410
 *         return ctx
 * 
 * fn = Function(None, None)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Function); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__283, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2410, __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_fn, __pyx_t_2) < 0) __PYX_ERR(0, 2410, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2413
 * 
 * 
 * class List(Node):             # <<<<<<<<<<<<<<
 *     def __init__(self, nodes, glue=' ', parentheses=False):
 *         self.nodes = nodes
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2413, __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, 2413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_List, __pyx_n_s_List, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2414
 * 
 * class List(Node):
 *     def __init__(self, nodes, glue=' ', parentheses=False):             # <<<<<<<<<<<<<<
 *         self.nodes = nodes
 *         self.glue = glue
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_4List_1__init__, 0, __pyx_n_s_List___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__285)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2414, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__286);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2414, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2423
 *                 self.nodes[0].flat = True
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         n = len(self.nodes)
 *         if n == 0:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_4List_3__sql__, 0, __pyx_n_s_List___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__288)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2423, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2413
 * 
 * 
 * class List(Node):             # <<<<<<<<<<<<<<
 *     def __init__(self, nodes, glue=' ', parentheses=False):
 *         self.nodes = nodes
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_List, __pyx_t_1, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_List, __pyx_t_4) < 0) __PYX_ERR(0, 2413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2435
 * 
 * 
 * def CommaList(nodes):             # <<<<<<<<<<<<<<
 *     return List(nodes, ', ')
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sweepea_21CommaList, NULL, __pyx_n_s_sweepea); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2435, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CommaList, __pyx_t_1) < 0) __PYX_ERR(0, 2435, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2439
 * 
 * 
 * def EnclosedList(nodes):             # <<<<<<<<<<<<<<
 *     return List(nodes, ', ', True)
 * 
 */
  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_7sweepea_23EnclosedList, NULL, __pyx_n_s_sweepea); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EnclosedList, __pyx_t_1) < 0) __PYX_ERR(0, 2439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2443
 * 
 * 
 * class Query(Node):             # <<<<<<<<<<<<<<
 *     commit = True
 * 
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2443, __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, 2443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_2, __pyx_n_s_Query, __pyx_n_s_Query, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "sweepea.pyx":2444
 * 
 * class Query(Node):
 *     commit = True             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, order_by=None, limit=None, offset=None, **kwargs):
 */
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_commit, Py_True) < 0) __PYX_ERR(0, 2444, __pyx_L1_error)

  /* "sweepea.pyx":2446
 *     commit = True
 * 
 *     def __init__(self, order_by=None, limit=None, offset=None, **kwargs):             # <<<<<<<<<<<<<<
 *         super(Query, self).__init__(**kwargs)
 *         self._order_by, self._limit, self._offset = order_by, limit, offset
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Query_1__init__, 0, __pyx_n_s_Query___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__294)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__295);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2446, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2452
 *         self._cursor = None
 * 
 *     def clone(self):             # <<<<<<<<<<<<<<
 *         query = super(Query, self).clone()
 *         query._cursor = None
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Query_3clone, 0, __pyx_n_s_Query_clone, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__297)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_clone, __pyx_t_4) < 0) __PYX_ERR(0, 2452, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2457
 *         return query
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def with_(self, *cte_list):
 *         self._cte_list = cte_list
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_copy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2458
 * 
 *     @Node.copy
 *     def with_(self, *cte_list):             # <<<<<<<<<<<<<<
 *         self._cte_list = cte_list
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Query_5with_, 0, __pyx_n_s_Query_with, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__299)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2457, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_with, __pyx_t_4) < 0) __PYX_ERR(0, 2458, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2461
 *         self._cte_list = cte_list
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def order_by(self, *values):
 *         self._order_by = values
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_copy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "sweepea.pyx":2462
 * 
 *     @Node.copy
 *     def order_by(self, *values):             # <<<<<<<<<<<<<<
 *         self._order_by = values
 * 
 */
  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Query_7order_by, 0, __pyx_n_s_Query_order_by, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__301)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2462, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2461, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_order_by, __pyx_t_4) < 0) __PYX_ERR(0, 2462, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2465
 *         self._order_by = values
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def order_by_extend(self, *values):
 *         self._order_by = ((self._order_by or ()) + values) or None
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "sweepea.pyx":2466
 * 
 *     @Node.copy
 *     def order_by_extend(self, *values):             # <<<<<<<<<<<<<<
 *         self._order_by = ((self._order_by or ()) + values) or None
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Query_9order_by_extend, 0, __pyx_n_s_Query_order_by_extend, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__303)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_9) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2465, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_order_by_extend, __pyx_t_4) < 0) __PYX_ERR(0, 2466, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2469
 *         self._order_by = ((self._order_by or ()) + values) or None
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def limit(self, limit=None):
 *         self._limit = limit
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "sweepea.pyx":2470
 * 
 *     @Node.copy
 *     def limit(self, limit=None):             # <<<<<<<<<<<<<<
 *         self._limit = limit
 * 
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Query_11limit, 0, __pyx_n_s_Query_limit, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__305)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__306);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2469, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2469, __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_3);
    PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_limit, __pyx_t_4) < 0) __PYX_ERR(0, 2470, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2473
 *         self._limit = limit
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def offset(self, offset=None):
 *         self._offset = offset
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_copy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2474
 * 
 *     @Node.copy
 *     def offset(self, offset=None):             # <<<<<<<<<<<<<<
 *         self._offset = offset
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Query_13offset, 0, __pyx_n_s_Query_offset, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__308)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__309);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2473, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_offset, __pyx_t_4) < 0) __PYX_ERR(0, 2474, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2477
 *         self._offset = offset
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def paginate(self, page, n=20):
 *         if page > 0:
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_copy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2477, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "sweepea.pyx":2478
 * 
 *     @Node.copy
 *     def paginate(self, page, n=20):             # <<<<<<<<<<<<<<
 *         if page > 0:
 *             page -= 1
 */
  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Query_15paginate, 0, __pyx_n_s_Query_paginate, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__311)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2478, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__312);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2477, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2477, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_paginate, __pyx_t_4) < 0) __PYX_ERR(0, 2478, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2484
 *         self._offset = page * n
 * 
 *     def apply_ordering(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self._order_by:
 *             ctx.literal(' ORDER BY ').sql(CommaList(self._order_by))
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Query_17apply_ordering, 0, __pyx_n_s_Query_apply_ordering, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__314)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2484, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_apply_ordering, __pyx_t_4) < 0) __PYX_ERR(0, 2484, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2493
 *         return ctx
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         if self._cte_list:
 *             recursive = any(cte._recursive for cte in self._cte_list)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Query_19__sql__, 0, __pyx_n_s_Query___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__316)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2493, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2503
 *         return ctx
 * 
 *     def execute(self, database):             # <<<<<<<<<<<<<<
 *         raise NotImplementedError
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_5Query_21execute, 0, __pyx_n_s_Query_execute, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__318)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_5, __pyx_n_s_execute, __pyx_t_4) < 0) __PYX_ERR(0, 2503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2443
 * 
 * 
 * class Query(Node):             # <<<<<<<<<<<<<<
 *     commit = True
 * 
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Query, __pyx_t_2, __pyx_t_5, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Query, __pyx_t_4) < 0) __PYX_ERR(0, 2443, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "sweepea.pyx":2507
 * 
 * 
 * class SelectBase(Source, Query):             # <<<<<<<<<<<<<<
 *     commit = False
 * 
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Source); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_Query); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_5, __pyx_n_s_SelectBase, __pyx_n_s_SelectBase, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "sweepea.pyx":2508
 * 
 * class SelectBase(Source, Query):
 *     commit = False             # <<<<<<<<<<<<<<
 * 
 *     def __add__(self, rhs):
 */
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_commit, Py_False) < 0) __PYX_ERR(0, 2508, __pyx_L1_error)

  /* "sweepea.pyx":2510
 *     commit = False
 * 
 *     def __add__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'UNION ALL', rhs)
 *     def __or__(self, rhs):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10SelectBase_1__add__, 0, __pyx_n_s_SelectBase___add, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__320)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_add, __pyx_t_4) < 0) __PYX_ERR(0, 2510, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2512
 *     def __add__(self, rhs):
 *         return CompoundSelect(self, 'UNION ALL', rhs)
 *     def __or__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'UNION', rhs)
 *     def __and__(self, rhs):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10SelectBase_3__or__, 0, __pyx_n_s_SelectBase___or, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__322)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_or, __pyx_t_4) < 0) __PYX_ERR(0, 2512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2514
 *     def __or__(self, rhs):
 *         return CompoundSelect(self, 'UNION', rhs)
 *     def __and__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'INTERSECT', rhs)
 *     def __sub__(self, rhs):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10SelectBase_5__and__, 0, __pyx_n_s_SelectBase___and, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__324)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_and_2, __pyx_t_4) < 0) __PYX_ERR(0, 2514, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2516
 *     def __and__(self, rhs):
 *         return CompoundSelect(self, 'INTERSECT', rhs)
 *     def __sub__(self, rhs):             # <<<<<<<<<<<<<<
 *         return CompoundSelect(self, 'EXCEPT', rhs)
 *     def cte(self, name, recursive=False, columns=None):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10SelectBase_7__sub__, 0, __pyx_n_s_SelectBase___sub, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__326)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2516, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_sub, __pyx_t_4) < 0) __PYX_ERR(0, 2516, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2518
 *     def __sub__(self, rhs):
 *         return CompoundSelect(self, 'EXCEPT', rhs)
 *     def cte(self, name, recursive=False, columns=None):             # <<<<<<<<<<<<<<
 *         return CTE(name, self, recursive, columns)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10SelectBase_9cte, 0, __pyx_n_s_SelectBase_cte, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__328)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__329);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_cte, __pyx_t_4) < 0) __PYX_ERR(0, 2518, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2507
 * 
 * 
 * class SelectBase(Source, Query):             # <<<<<<<<<<<<<<
 *     commit = False
 * 
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_SelectBase, __pyx_t_5, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2507, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SelectBase, __pyx_t_4) < 0) __PYX_ERR(0, 2507, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":2522
 * 
 * 
 * class CompoundSelect(SelectBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, lhs, op, rhs):
 *         super(CompoundSelect, self).__init__()
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_SelectBase); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2522, __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_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_1, __pyx_n_s_CompoundSelect, __pyx_n_s_CompoundSelect, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "sweepea.pyx":2523
 * 
 * class CompoundSelect(SelectBase):
 *     def __init__(self, lhs, op, rhs):             # <<<<<<<<<<<<<<
 *         super(CompoundSelect, self).__init__()
 *         self.lhs = lhs
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_14CompoundSelect_1__init__, 0, __pyx_n_s_CompoundSelect___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__331)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2529
 *         self.rhs = rhs
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         with ctx(parentheses=ctx.scope == SCOPE_SOURCE):
 *             with ctx(parentheses=False):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_14CompoundSelect_3__sql__, 0, __pyx_n_s_CompoundSelect___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__333)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2529, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2539
 *         return self.apply_alias(ctx)
 * 
 *     def execute(self, database):             # <<<<<<<<<<<<<<
 *         return CursorWrapper(database.execute(self))
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_14CompoundSelect_5execute, 0, __pyx_n_s_CompoundSelect_execute, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__335)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_execute, __pyx_t_4) < 0) __PYX_ERR(0, 2539, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2522
 * 
 * 
 * class CompoundSelect(SelectBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, lhs, op, rhs):
 *         super(CompoundSelect, self).__init__()
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_CompoundSelect, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CompoundSelect, __pyx_t_4) < 0) __PYX_ERR(0, 2522, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2543
 * 
 * 
 * class Select(SelectBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, from_clause=None, columns=None, where=None,
 *                  group_by=None, having=None, order_by=None, limit=None,
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_SelectBase); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2543, __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_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_5, __pyx_n_s_Select, __pyx_n_s_Select, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "sweepea.pyx":2544
 * 
 * class Select(SelectBase):
 *     def __init__(self, from_clause=None, columns=None, where=None,             # <<<<<<<<<<<<<<
 *                  group_by=None, having=None, order_by=None, limit=None,
 *                  offset=None, distinct=None):
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Select_1__init__, 0, __pyx_n_s_Select___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__337)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__338);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2544, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2562
 *         self._objects = False
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def select(self, *columns):
 *         self._columns = columns
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "sweepea.pyx":2563
 * 
 *     @Node.copy
 *     def select(self, *columns):             # <<<<<<<<<<<<<<
 *         self._columns = columns
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Select_3select, 0, __pyx_n_s_Select_select, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__340)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_9) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2562, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_select, __pyx_t_4) < 0) __PYX_ERR(0, 2563, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2566
 *         self._columns = columns
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def join(self, dest, join_type='INNER', on=None):
 *         if not self._from:
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "sweepea.pyx":2567
 * 
 *     @Node.copy
 *     def join(self, dest, join_type='INNER', on=None):             # <<<<<<<<<<<<<<
 *         if not self._from:
 *             raise ValueError('No sources to join on.')
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Select_5join, 0, __pyx_n_s_Select_join, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__342)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_3, __pyx_tuple__343);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2566, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2566, __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_3);
    PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_join, __pyx_t_4) < 0) __PYX_ERR(0, 2567, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2573
 *         self._from.append(Join(item, dest, join_type, on))
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def where(self, *expressions):
 *         if self._where is not None:
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_copy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2574
 * 
 *     @Node.copy
 *     def where(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Select_7where, 0, __pyx_n_s_Select_where, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__345)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2574, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2573, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_where, __pyx_t_4) < 0) __PYX_ERR(0, 2574, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2579
 *         self._where = reduce(operator.and_, expressions)
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def group_by(self, *columns):
 *         self._group_by = columns
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_copy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "sweepea.pyx":2580
 * 
 *     @Node.copy
 *     def group_by(self, *columns):             # <<<<<<<<<<<<<<
 *         self._group_by = columns
 * 
 */
  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Select_9group_by, 0, __pyx_n_s_Select_group_by, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__347)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2579, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_group_by, __pyx_t_4) < 0) __PYX_ERR(0, 2580, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2583
 *         self._group_by = columns
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def group_by_extend(self, *columns):
 *         self._group_by = ((self._group_by or ()) + columns) or None
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "sweepea.pyx":2584
 * 
 *     @Node.copy
 *     def group_by_extend(self, *columns):             # <<<<<<<<<<<<<<
 *         self._group_by = ((self._group_by or ()) + columns) or None
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Select_11group_by_extend, 0, __pyx_n_s_Select_group_by_extend, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__349)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_9) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2583, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_group_by_extend, __pyx_t_4) < 0) __PYX_ERR(0, 2584, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2587
 *         self._group_by = ((self._group_by or ()) + columns) or None
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def having(self, *expressions):
 *         if self._having is not None:
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2587, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "sweepea.pyx":2588
 * 
 *     @Node.copy
 *     def having(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._having is not None:
 *             expressions = (self._having,) + expressions
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Select_13having, 0, __pyx_n_s_Select_having, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__351)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2587, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2587, __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_3);
    PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_having, __pyx_t_4) < 0) __PYX_ERR(0, 2588, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2593
 *         self._having = reduce(operator.and_, expressions)
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def distinct(self, is_distinct=True):
 *         self._distinct = is_distinct
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_copy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2594
 * 
 *     @Node.copy
 *     def distinct(self, is_distinct=True):             # <<<<<<<<<<<<<<
 *         self._distinct = is_distinct
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Select_15distinct, 0, __pyx_n_s_Select_distinct, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__353)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__354);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2593, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_distinct, __pyx_t_4) < 0) __PYX_ERR(0, 2594, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2597
 *         self._distinct = is_distinct
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def dicts(self, as_dict=True):
 *         self._dicts = as_dict
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_copy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "sweepea.pyx":2598
 * 
 *     @Node.copy
 *     def dicts(self, as_dict=True):             # <<<<<<<<<<<<<<
 *         self._dicts = as_dict
 * 
 */
  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Select_17dicts, 0, __pyx_n_s_Select_dicts, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__356)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_9, __pyx_tuple__357);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2597, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_dicts_2, __pyx_t_4) < 0) __PYX_ERR(0, 2598, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2601
 *         self._dicts = as_dict
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def objects(self, as_object=True):
 *         self._objects = as_object
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "sweepea.pyx":2602
 * 
 *     @Node.copy
 *     def objects(self, as_object=True):             # <<<<<<<<<<<<<<
 *         self._objects = as_object
 * 
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Select_19objects, 0, __pyx_n_s_Select_objects, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__359)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_8, __pyx_tuple__360);
  __pyx_t_9 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_9) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2601, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_objects_2, __pyx_t_4) < 0) __PYX_ERR(0, 2602, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2605
 *         self._objects = as_object
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         super(Select, self).__sql__(ctx)
 *         is_subquery = ctx.subquery
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Select_21__sql__, 0, __pyx_n_s_Select___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__362)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2605, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2605, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2631
 *         return self.apply_alias(ctx)
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         cursor = database.execute(self)
 *         if self._dicts:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Select_23execute, 0, __pyx_n_s_Select_execute, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__364)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2631, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_execute, __pyx_t_4) < 0) __PYX_ERR(0, 2631, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2543
 * 
 * 
 * class Select(SelectBase):             # <<<<<<<<<<<<<<
 *     def __init__(self, from_clause=None, columns=None, where=None,
 *                  group_by=None, having=None, order_by=None, limit=None,
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Select, __pyx_t_5, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Select, __pyx_t_4) < 0) __PYX_ERR(0, 2543, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":2641
 * 
 * 
 * class WriteQuery(Query):             # <<<<<<<<<<<<<<
 *     def __init__(self, table, *args, **kwargs):
 *         super(WriteQuery, self).__init__(*args, **kwargs)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Query); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2641, __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_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_1, __pyx_n_s_WriteQuery, __pyx_n_s_WriteQuery, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "sweepea.pyx":2642
 * 
 * class WriteQuery(Query):
 *     def __init__(self, table, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         super(WriteQuery, self).__init__(*args, **kwargs)
 *         self.table = table
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_10WriteQuery_1__init__, 0, __pyx_n_s_WriteQuery___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__366)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2642, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2641
 * 
 * 
 * class WriteQuery(Query):             # <<<<<<<<<<<<<<
 *     def __init__(self, table, *args, **kwargs):
 *         super(WriteQuery, self).__init__(*args, **kwargs)
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_WriteQuery, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WriteQuery, __pyx_t_4) < 0) __PYX_ERR(0, 2641, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2647
 * 
 * 
 * class Update(WriteQuery):             # <<<<<<<<<<<<<<
 *     def __init__(self, table, data=None, where=None, order_by=None, limit=None,
 *                  offset=None, on_conflict=None):
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_WriteQuery); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2647, __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_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_5, __pyx_n_s_Update, __pyx_n_s_Update, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "sweepea.pyx":2648
 * 
 * class Update(WriteQuery):
 *     def __init__(self, table, data=None, where=None, order_by=None, limit=None,             # <<<<<<<<<<<<<<
 *                  offset=None, on_conflict=None):
 *         super(Update, self).__init__(table, order_by=order_by, limit=limit,
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Update_1__init__, 0, __pyx_n_s_Update___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__368)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__369);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2648, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2656
 *         self._on_conflict = on_conflict
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def where(self, *expressions):
 *         if self._where is not None:
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_copy); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "sweepea.pyx":2657
 * 
 *     @Node.copy
 *     def where(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Update_3where, 0, __pyx_n_s_Update_where, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__371)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  if (!__pyx_t_8) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2656, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2656, __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_3);
    PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_where, __pyx_t_4) < 0) __PYX_ERR(0, 2657, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2662
 *         self._where = reduce(operator.and_, expressions)
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def on_conflict(self, on_conflict):
 *         self._on_conflict = on_conflict
 */
  __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_copy); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "sweepea.pyx":2663
 * 
 *     @Node.copy
 *     def on_conflict(self, on_conflict):             # <<<<<<<<<<<<<<
 *         self._on_conflict = on_conflict
 * 
 */
  __pyx_t_7 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Update_5on_conflict, 0, __pyx_n_s_Update_on_conflict, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__373)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2663, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2662, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3); __pyx_t_3 = NULL;
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_on_conflict, __pyx_t_4) < 0) __PYX_ERR(0, 2663, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2666
 *         self._on_conflict = on_conflict
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         with ctx.scope_values(subquery=True):
 *             ctx.literal('UPDATE ')
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Update_7__sql__, 0, __pyx_n_s_Update___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__375)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2666, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2684
 *             return self.apply_ordering(ctx)
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         database.execute(self)
 *         return database.changes()
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Update_9execute, 0, __pyx_n_s_Update_execute, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__377)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_execute, __pyx_t_4) < 0) __PYX_ERR(0, 2684, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2647
 * 
 * 
 * class Update(WriteQuery):             # <<<<<<<<<<<<<<
 *     def __init__(self, table, data=None, where=None, order_by=None, limit=None,
 *                  offset=None, on_conflict=None):
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Update, __pyx_t_5, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2647, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Update, __pyx_t_4) < 0) __PYX_ERR(0, 2647, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":2689
 * 
 * 
 * class Insert(WriteQuery):             # <<<<<<<<<<<<<<
 *     def __init__(self, table, data=None, columns=None, on_conflict=None):
 *         super(Insert, self).__init__(table)
 */
  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_WriteQuery); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2689, __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_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_1, __pyx_n_s_Insert, __pyx_n_s_Insert, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "sweepea.pyx":2690
 * 
 * class Insert(WriteQuery):
 *     def __init__(self, table, data=None, columns=None, on_conflict=None):             # <<<<<<<<<<<<<<
 *         super(Insert, self).__init__(table)
 *         self.data = data
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Insert_1__init__, 0, __pyx_n_s_Insert___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__379)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__380);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2690, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2696
 *         self._on_conflict = on_conflict
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def on_conflict(self, on_conflict):
 *         self._on_conflict = on_conflict
 */
  __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_copy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "sweepea.pyx":2697
 * 
 *     @Node.copy
 *     def on_conflict(self, on_conflict):             # <<<<<<<<<<<<<<
 *         self._on_conflict = on_conflict
 * 
 */
  __pyx_t_9 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Insert_3on_conflict, 0, __pyx_n_s_Insert_on_conflict, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__382)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 2697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
    }
  }
  if (!__pyx_t_7) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2696, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_7); __pyx_t_7 = NULL;
    __Pyx_GIVEREF(__pyx_t_9);
    PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_9);
    __pyx_t_9 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_on_conflict, __pyx_t_4) < 0) __PYX_ERR(0, 2697, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2700
 *         self._on_conflict = on_conflict
 * 
 *     def _simple_insert(self, Context ctx):             # <<<<<<<<<<<<<<
 *         columns, values = [], []
 *         for key, value in self.data.items():
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Insert_5_simple_insert, 0, __pyx_n_s_Insert__simple_insert, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__384)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_simple_insert, __pyx_t_4) < 0) __PYX_ERR(0, 2700, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2712
 *                 .sql(EnclosedList(values)))
 * 
 *     def _multi_insert(self, Context ctx):             # <<<<<<<<<<<<<<
 *         rows_iter = iter(self.data)
 *         columns = self._columns
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Insert_7_multi_insert, 0, __pyx_n_s_Insert__multi_insert, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__386)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_multi_insert, __pyx_t_4) < 0) __PYX_ERR(0, 2712, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2737
 *         return ctx.sql(CommaList(all_values))
 * 
 *     def _query_insert(self, Context ctx):             # <<<<<<<<<<<<<<
 *         return (ctx
 *                 .sql(EnclosedList(self._columns))
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Insert_9_query_insert, 0, __pyx_n_s_Insert__query_insert, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__388)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2737, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_query_insert, __pyx_t_4) < 0) __PYX_ERR(0, 2737, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2743
 *                 .sql(self.data))
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         super(Insert, self).__sql__(ctx)
 *         with ctx.scope_values():
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Insert_11__sql__, 0, __pyx_n_s_Insert___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__390)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2743, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2758
 *         return ctx
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         database.execute(self)
 *         return database.last_insert_rowid()
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Insert_13execute, 0, __pyx_n_s_Insert_execute, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__392)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_execute, __pyx_t_4) < 0) __PYX_ERR(0, 2758, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2689
 * 
 * 
 * class Insert(WriteQuery):             # <<<<<<<<<<<<<<
 *     def __init__(self, table, data=None, columns=None, on_conflict=None):
 *         super(Insert, self).__init__(table)
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_Insert, __pyx_t_1, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Insert, __pyx_t_4) < 0) __PYX_ERR(0, 2689, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "sweepea.pyx":2763
 * 
 * 
 * class Delete(WriteQuery):             # <<<<<<<<<<<<<<
 *     def __init__(self, table, where=None, **kwargs):
 *         super(Delete, self).__init__(table, **kwargs)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_WriteQuery); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2763, __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_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __pyx_t_5, __pyx_n_s_Delete, __pyx_n_s_Delete, (PyObject *) NULL, __pyx_n_s_sweepea, (PyObject *) NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "sweepea.pyx":2764
 * 
 * class Delete(WriteQuery):
 *     def __init__(self, table, where=None, **kwargs):             # <<<<<<<<<<<<<<
 *         super(Delete, self).__init__(table, **kwargs)
 *         self._where = where
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Delete_1__init__, 0, __pyx_n_s_Delete___init, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__394)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_tuple__395);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 2764, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2768
 *         self._where = where
 * 
 *     @Node.copy             # <<<<<<<<<<<<<<
 *     def where(self, *expressions):
 *         if self._where is not None:
 */
  __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_Node); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_copy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2768, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

  /* "sweepea.pyx":2769
 * 
 *     @Node.copy
 *     def where(self, *expressions):             # <<<<<<<<<<<<<<
 *         if self._where is not None:
 *             expressions = (self._where,) + expressions
 */
  __pyx_t_8 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Delete_3where, 0, __pyx_n_s_Delete_where, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__397)); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 2769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_9)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_9);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_9) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2768, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    __pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 2768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
    __Pyx_GIVEREF(__pyx_t_8);
    PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_8);
    __pyx_t_8 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2768, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_where, __pyx_t_4) < 0) __PYX_ERR(0, 2769, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2774
 *         self._where = reduce(operator.and_, expressions)
 * 
 *     def __sql__(self, Context ctx):             # <<<<<<<<<<<<<<
 *         super(Delete, self).__sql__(ctx)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Delete_5__sql__, 0, __pyx_n_s_Delete___sql, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__399)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_sql_2, __pyx_t_4) < 0) __PYX_ERR(0, 2774, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2783
 *             return self.apply_ordering(ctx)
 * 
 *     def execute(self, Database database):             # <<<<<<<<<<<<<<
 *         database.execute(self)
 *         return database.changes()
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_7sweepea_6Delete_7execute, 0, __pyx_n_s_Delete_execute, NULL, __pyx_n_s_sweepea, __pyx_d, ((PyObject *)__pyx_codeobj__401)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2783, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyObject_SetItem(__pyx_t_2, __pyx_n_s_execute, __pyx_t_4) < 0) __PYX_ERR(0, 2783, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "sweepea.pyx":2763
 * 
 * 
 * class Delete(WriteQuery):             # <<<<<<<<<<<<<<
 *     def __init__(self, table, where=None, **kwargs):
 *         super(Delete, self).__init__(table, **kwargs)
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Delete, __pyx_t_5, __pyx_t_2, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2763, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Delete, __pyx_t_4) < 0) __PYX_ERR(0, 2763, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":2788
 * 
 * SQLITE_DATETIME_FORMATS = (
 *     '%Y-%m-%d %H:%M:%S',             # <<<<<<<<<<<<<<
 *     '%Y-%m-%d %H:%M:%S.%f',
 *     '%Y-%m-%d',
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SQLITE_DATETIME_FORMATS, __pyx_tuple__402) < 0) __PYX_ERR(0, 2787, __pyx_L1_error)

  /* "sweepea.pyx":2795
 *     '%H:%M')
 * SQLITE_DATE_FORMATS = (
 *     '%Y-%m-%d',             # <<<<<<<<<<<<<<
 *     '%Y-%m-%d %H:%M:%S',
 *     '%Y-%m-%d %H:%M:%S.%f')
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SQLITE_DATE_FORMATS, __pyx_tuple__403) < 0) __PYX_ERR(0, 2794, __pyx_L1_error)

  /* "sweepea.pyx":2799
 *     '%Y-%m-%d %H:%M:%S.%f')
 * SQLITE_TIME_FORMATS = (
 *     '%H:%M:%S',             # <<<<<<<<<<<<<<
 *     '%H:%M:%S.%f',
 *     '%H:%M',
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SQLITE_TIME_FORMATS, __pyx_tuple__404) < 0) __PYX_ERR(0, 2798, __pyx_L1_error)

  /* "sweepea.pyx":2833
 * 
 * 
 * pysqlite.register_adapter(decimal.Decimal, str)             # <<<<<<<<<<<<<<
 * pysqlite.register_adapter(datetime.date, str)
 * pysqlite.register_adapter(datetime.time, str)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pysqlite); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register_adapter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_decimal); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_Decimal); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_1) {
    __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
  }
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_t_4);
  __Pyx_INCREF(((PyObject *)(&PyString_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, ((PyObject *)(&PyString_Type)));
  __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":2834
 * 
 * pysqlite.register_adapter(decimal.Decimal, str)
 * pysqlite.register_adapter(datetime.date, str)             # <<<<<<<<<<<<<<
 * pysqlite.register_adapter(datetime.time, str)
 * pysqlite.register_converter('DATETIME', format_datetime)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pysqlite); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_adapter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7cpython_8datetime_date));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cpython_8datetime_date));
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, ((PyObject *)__pyx_ptype_7cpython_8datetime_date));
  __Pyx_INCREF(((PyObject *)(&PyString_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, ((PyObject *)(&PyString_Type)));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":2835
 * pysqlite.register_adapter(decimal.Decimal, str)
 * pysqlite.register_adapter(datetime.date, str)
 * pysqlite.register_adapter(datetime.time, str)             # <<<<<<<<<<<<<<
 * pysqlite.register_converter('DATETIME', format_datetime)
 * pysqlite.register_converter('DATE', format_date)
 */
  __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_pysqlite); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_register_adapter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(((PyObject *)__pyx_ptype_7cpython_8datetime_time));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_7cpython_8datetime_time));
  PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, ((PyObject *)__pyx_ptype_7cpython_8datetime_time));
  __Pyx_INCREF(((PyObject *)(&PyString_Type)));
  __Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
  PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, ((PyObject *)(&PyString_Type)));
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2835, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":2836
 * pysqlite.register_adapter(datetime.date, str)
 * pysqlite.register_adapter(datetime.time, str)
 * pysqlite.register_converter('DATETIME', format_datetime)             # <<<<<<<<<<<<<<
 * pysqlite.register_converter('DATE', format_date)
 * pysqlite.register_converter('TIME', format_time)
 */
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pysqlite); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_register_converter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_format_datetime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_1 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__pyx_t_3) {
    __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
  }
  __Pyx_INCREF(__pyx_n_s_DATETIME);
  __Pyx_GIVEREF(__pyx_n_s_DATETIME);
  PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_6, __pyx_n_s_DATETIME);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_6, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":2837
 * pysqlite.register_adapter(datetime.time, str)
 * pysqlite.register_converter('DATETIME', format_datetime)
 * pysqlite.register_converter('DATE', format_date)             # <<<<<<<<<<<<<<
 * pysqlite.register_converter('TIME', format_time)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pysqlite); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_register_converter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_format_date); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 2837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_3 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_4) {
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); __pyx_t_4 = NULL;
  }
  __Pyx_INCREF(__pyx_n_s_DATE);
  __Pyx_GIVEREF(__pyx_n_s_DATE);
  PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_6, __pyx_n_s_DATE);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_6, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2837, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":2838
 * pysqlite.register_converter('DATETIME', format_datetime)
 * pysqlite.register_converter('DATE', format_date)
 * pysqlite.register_converter('TIME', format_time)             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pysqlite); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_register_converter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_format_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  __pyx_t_4 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_n_s_TIME);
  __Pyx_GIVEREF(__pyx_n_s_TIME);
  PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_n_s_TIME);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 2838, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "sweepea.pyx":1
 * from cpython cimport datetime             # <<<<<<<<<<<<<<
 * from cpython.mem cimport PyMem_Free
 * from cpython.object cimport PyObject
 */
  __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "cfunc.to_py":64
 * 
 * @cname("__Pyx_CFunc_bint____basestring____basestring___to_py")
 * cdef object __Pyx_CFunc_bint____basestring____basestring___to_py(bint (*f)(basestring, basestring) except *):             # <<<<<<<<<<<<<<
 *     def wrap(basestring value, basestring regex):
 *         """wrap(value: basestring, regex: basestring) -> bool"""
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init sweepea", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init sweepea");
  }
  __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;
}

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

/* 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) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* PyObjectCallNoArg */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyErrFetchRestore */
    #if CYTHON_COMPILING_IN_CPYTHON
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
}

/* SaveResetException */
    #if CYTHON_COMPILING_IN_CPYTHON
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_COMPILING_IN_CPYTHON
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_COMPILING_IN_CPYTHON
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_COMPILING_IN_CPYTHON
    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_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* 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_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        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));
}

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

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

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

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

/* GetModuleGlobalName */
        static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

/* 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_COMPILING_IN_CPYTHON
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    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_COMPILING_IN_CPYTHON
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* SliceTupleAndList */
          #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
    Py_ssize_t start = *_start, stop = *_stop, length = *_length;
    if (start < 0) {
        start += length;
        if (start < 0)
            start = 0;
    }
    if (stop < 0)
        stop += length;
    else if (stop > length)
        stop = length;
    *_length = stop - start;
    *_start = start;
    *_stop = stop;
}
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyList_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyList_New(0);
    dest = PyList_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyListObject*)src)->ob_item + start,
        ((PyListObject*)dest)->ob_item,
        length);
    return dest;
}
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyTuple_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyTuple_New(0);
    dest = PyTuple_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyTupleObject*)src)->ob_item + start,
        ((PyTupleObject*)dest)->ob_item,
        length);
    return dest;
}
#endif

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

/* pyobject_as_double */
          static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
#if CYTHON_COMPILING_IN_PYPY
    float_value = PyNumber_Float(obj);  if (0) goto bad;
#else
    PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
    if (likely(nb) && likely(nb->nb_float)) {
        float_value = nb->nb_float(obj);
        if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
            PyErr_Format(PyExc_TypeError,
                "__float__ returned non-float (type %.200s)",
                Py_TYPE(float_value)->tp_name);
            Py_DECREF(float_value);
            goto bad;
        }
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
#endif
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

/* PyIntBinop */
          #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
        double b = PyFloat_AS_DOUBLE(op2);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyIntBinop */
          #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* KeywordStringCheck */
          static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* None */
          static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* 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_COMPILING_IN_CPYTHON
    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
}
#if CYTHON_COMPILING_IN_PYPY
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    PyObject *self = f->m_self;
    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;
}
#else
static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
	return PyCFunction_Call(func, arg, kw);
}
#endif
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_Call,
    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) {
#if !CYTHON_COMPILING_IN_PYPY
    __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
#endif
    __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);
}

/* None */
              static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
    long r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

/* ArgTypeTest */
              static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (likely(Py_TYPE(obj) == type)) return 1;
        #if PY_MAJOR_VERSION == 2
        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(PyObject_TypeCheck(obj, type))) return 1;
    }
    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
    return 0;
}

/* IterNext */
              static CYTHON_INLINE PyObject *__Pyx_PyIter_Next2(PyObject* iterator, PyObject* defval) {
    PyObject* next;
    iternextfunc iternext = Py_TYPE(iterator)->tp_iternext;
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(!iternext)) {
#else
    if (unlikely(!iternext) || unlikely(!PyIter_Check(iterator))) {
#endif
        PyErr_Format(PyExc_TypeError,
            "%.200s object is not an iterator", Py_TYPE(iterator)->tp_name);
        return NULL;
    }
    next = iternext(iterator);
    if (likely(next))
        return next;
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_VERSION_HEX >= 0x02070000
    if (unlikely(iternext == &_PyObject_NextNotImplemented))
        return NULL;
#endif
#endif
    if (defval) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
            if (unlikely(exc_type != PyExc_StopIteration) &&
                    !PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))
                return NULL;
            PyErr_Clear();
        }
        Py_INCREF(defval);
        return defval;
    }
    if (!PyErr_Occurred())
        PyErr_SetNone(PyExc_StopIteration);
    return NULL;
}

/* PyObjectCallMethod2 */
                static PyObject* __Pyx_PyObject_CallMethod2(PyObject* obj, PyObject* method_name, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method)) && likely(PyMethod_GET_SELF(method))) {
        PyObject *self, *function;
        self = PyMethod_GET_SELF(method);
        function = PyMethod_GET_FUNCTION(method);
        args = PyTuple_New(3);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 1, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 2, arg2);
        Py_INCREF(function);
        Py_DECREF(method);
        method = function;
    } else
#endif
    {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
    }
    result = __Pyx_PyObject_Call(method, args, NULL);
    Py_DECREF(args);
    Py_DECREF(method);
    return result;
bad:
    Py_XDECREF(method);
    return result;
}

/* dict_setdefault */
                static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value,
                                                       CYTHON_UNUSED int is_safe_type) {
    PyObject* value;
#if PY_VERSION_HEX >= 0x030400A0
    if (1) {
        value = PyDict_SetDefault(d, key, default_value);
        if (unlikely(!value)) return NULL;
        Py_INCREF(value);
#else
    if (is_safe_type == 1 || (is_safe_type == -1 &&
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
            (PyUnicode_CheckExact(key) || PyString_CheckExact(key) || PyLong_CheckExact(key)))) {
        value = PyDict_GetItemWithError(d, key);
        if (unlikely(!value)) {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            if (unlikely(PyDict_SetItem(d, key, default_value) == -1))
                return NULL;
            value = default_value;
        }
        Py_INCREF(value);
#else
            (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key) || PyLong_CheckExact(key)))) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            if (unlikely(PyDict_SetItem(d, key, default_value) == -1))
                return NULL;
            value = default_value;
        }
        Py_INCREF(value);
#endif
#endif
    } else {
        value = __Pyx_PyObject_CallMethod2(d, __pyx_n_s_setdefault, key, default_value);
    }
    return value;
}

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

/* GetAttr3 */
                    static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            goto bad;
        PyErr_Clear();
        r = d;
        Py_INCREF(d);
    }
    return r;
bad:
    return NULL;
}

/* IterFinish */
                    static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

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

/* UnpackUnboundCMethod */
                    static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(PyObject_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_O | METH_NOARGS);
    }
#endif
    return 0;
}

/* CallUnboundCMethod0 */
                    static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    args = PyTuple_New(1);
    if (unlikely(!args)) goto bad;
    Py_INCREF(self);
    PyTuple_SET_ITEM(args, 0, self);
#else
    args = PyTuple_Pack(1, self);
    if (unlikely(!args)) goto bad;
#endif
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    Py_DECREF(args);
bad:
    return result;
}

/* py_dict_items */
                    static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_items, d);
    else
        return PyDict_Items(d);
}

/* RaiseNoneIterError */
                    static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* 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 bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

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

/* PyObjectCallMethod0 */
                    static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *function = PyMethod_GET_FUNCTION(method);
            result = __Pyx_PyObject_CallOneArg(function, self);
            Py_DECREF(method);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* pop */
                    static CYTHON_INLINE PyObject* __Pyx__PyObject_Pop(PyObject* L) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (Py_TYPE(L) == &PySet_Type) {
        return PySet_Pop(L);
    }
#endif
    return __Pyx_PyObject_CallMethod0(L, __pyx_n_s_pop);
}
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_Pop(PyObject* L) {
    if (likely(PyList_GET_SIZE(L) > (((PyListObject*)L)->allocated >> 1))) {
        Py_SIZE(L) -= 1;
        return PyList_GET_ITEM(L, PyList_GET_SIZE(L));
    }
    return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyList_Type_pop, L);
}
#endif

/* ExtTypeTest */
                    static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(PyObject_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* PyIntBinop */
                    #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) {
            Py_RETURN_TRUE;
        } else {
            Py_RETURN_FALSE;
        }
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
                default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
                #else
                default: Py_RETURN_FALSE;
                #endif
            }
        }
            if (a == b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            if ((double)a == (double)b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    return PyObject_RichCompare(op1, op2, Py_EQ);
}
#endif

/* SwapException */
                    #if CYTHON_COMPILING_IN_CPYTHON
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

/* UnpackTupleError */
                    static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
                    static CYTHON_INLINE int __Pyx_unpack_tuple2(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                             int is_tuple, int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    if (!is_tuple && unlikely(!PyTuple_Check(tuple))) {
        iternextfunc iternext;
        iter = PyObject_GetIter(tuple);
        if (unlikely(!iter)) goto bad;
        if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
        iternext = Py_TYPE(iter)->tp_iternext;
        value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
        value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
        if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
        Py_DECREF(iter);
    } else {
        if (!has_known_size && unlikely(PyTuple_GET_SIZE(tuple) != 2)) {
            __Pyx_UnpackTupleError(tuple, 2);
            goto bad;
        }
#if CYTHON_COMPILING_IN_PYPY
        value1 = PySequence_ITEM(tuple, 0);
        if (unlikely(!value1)) goto bad;
        value2 = PySequence_ITEM(tuple, 1);
        if (unlikely(!value2)) goto bad;
#else
        value1 = PyTuple_GET_ITEM(tuple, 0);
        value2 = PyTuple_GET_ITEM(tuple, 1);
        Py_INCREF(value1);
        Py_INCREF(value2);
#endif
        if (decref_tuple) { Py_DECREF(tuple); }
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
                    static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
#if !CYTHON_COMPILING_IN_PYPY
    if (is_dict) {
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
    }
#endif
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* MergeKeywords */
                    static int __Pyx_MergeKeywords(PyObject *kwdict, PyObject *source_mapping) {
    PyObject *iter, *key = NULL, *value = NULL;
    int source_is_dict, result;
    Py_ssize_t orig_length, ppos = 0;
    iter = __Pyx_dict_iterator(source_mapping, 0, __pyx_n_s_items, &orig_length, &source_is_dict);
    if (unlikely(!iter)) {
        PyObject *args;
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        args = PyTuple_Pack(1, source_mapping);
        if (likely(args)) {
            PyObject *fallback = PyObject_Call((PyObject*)&PyDict_Type, args, NULL);
            Py_DECREF(args);
            if (likely(fallback)) {
                iter = __Pyx_dict_iterator(fallback, 1, __pyx_n_s_items, &orig_length, &source_is_dict);
                Py_DECREF(fallback);
            }
        }
        if (unlikely(!iter)) goto bad;
    }
    while (1) {
        result = __Pyx_dict_iter_next(iter, orig_length, &ppos, &key, &value, NULL, source_is_dict);
        if (unlikely(result < 0)) goto bad;
        if (!result) break;
        if (unlikely(PyDict_Contains(kwdict, key))) {
            __Pyx_RaiseDoubleKeywordsError("function", key);
            result = -1;
        } else {
            result = PyDict_SetItem(kwdict, key, value);
        }
        Py_DECREF(key);
        Py_DECREF(value);
        if (unlikely(result < 0)) goto bad;
    }
    Py_XDECREF(iter);
    return 0;
bad:
    Py_XDECREF(iter);
    return -1;
}

/* dict_getitem_default */
                    static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    } else {
        if (default_value == Py_None)
            default_value = NULL;
        value = PyObject_CallMethodObjArgs(
            d, __pyx_n_s_get_2, key, default_value, NULL);
    }
#endif
    return value;
}

/* PyIntBinop */
                    #if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx_PyInt_SubtractObjC(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_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    }
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* CallNextTpTraverse */
                    static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_traverse != current_tp_traverse)
        type = type->tp_base;
    while (type && type->tp_traverse == current_tp_traverse)
        type = type->tp_base;
    if (type && type->tp_traverse)
        return type->tp_traverse(obj, v, a);
    return 0;
}

/* CallNextTpClear */
                    static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_clear != current_tp_clear)
        type = type->tp_base;
    while (type && type->tp_clear == current_tp_clear)
        type = type->tp_base;
    if (type && type->tp_clear)
        type->tp_clear(obj);
}

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

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

/* 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;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* 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);
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* 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_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);
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),
                                     little, !is_unsigned);
    }
}

/* None */
                    static CYTHON_INLINE long __Pyx_pow_long(long b, long e) {
    long t = b;
    switch (e) {
        case 3:
            t *= b;
        case 2:
            t *= b;
        case 1:
            return t;
        case 0:
            return 1;
    }
    #if 1
    if (unlikely(e<0)) return 0;
    #endif
    t = 1;
    while (likely(e)) {
        t *= (b * (e&1)) | ((~e)&1);
        b *= b;
        e >>= 1;
    }
    return t;
}

/* 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);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
                    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                     little, !is_unsigned);
    }
}

/* ClassMethod */
                    static PyObject* __Pyx_Method_ClassMethod(PyObject *method) {
#if CYTHON_COMPILING_IN_PYPY
    if (PyObject_TypeCheck(method, &PyWrapperDescr_Type)) {
        return PyClassMethod_New(method);
    }
#else
    static PyTypeObject *methoddescr_type = NULL;
    if (methoddescr_type == NULL) {
       PyObject *meth = PyObject_GetAttrString((PyObject*)&PyList_Type, "append");
       if (!meth) return NULL;
       methoddescr_type = Py_TYPE(meth);
       Py_DECREF(meth);
    }
    if (PyObject_TypeCheck(method, methoddescr_type)) {
        PyMethodDescrObject *descr = (PyMethodDescrObject *)method;
        #if PY_VERSION_HEX < 0x03020000
        PyTypeObject *d_type = descr->d_type;
        #else
        PyTypeObject *d_type = descr->d_common.d_type;
        #endif
        return PyDescr_NewClassMethod(d_type, descr->d_method);
    }
#endif
    else if (PyMethod_Check(method)) {
        return PyClassMethod_New(PyMethod_GET_FUNCTION(method));
    }
    else if (PyCFunction_Check(method)) {
        return PyClassMethod_New(method);
    }
#ifdef __Pyx_CyFunction_USED
    else if (PyObject_TypeCheck(method, __pyx_CyFunctionType)) {
        return PyClassMethod_New(method);
    }
#endif
    PyErr_SetString(PyExc_TypeError,
                   "Class-level classmethod() can only be called on "
                   "a method_descriptor or instance method.");
    return NULL;
}

/* 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))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_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 sqlite3_int64 __Pyx_PyInt_As_sqlite3_int64(PyObject *x) {
    const sqlite3_int64 neg_one = (sqlite3_int64) -1, const_zero = (sqlite3_int64) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(sqlite3_int64) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(sqlite3_int64, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (sqlite3_int64) 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 (sqlite3_int64) 0;
                case  1: __PYX_VERIFY_RETURN_INT(sqlite3_int64, digit, digits[0])
                case 2:
                    if (8 * sizeof(sqlite3_int64) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(sqlite3_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(sqlite3_int64) >= 2 * PyLong_SHIFT) {
                            return (sqlite3_int64) (((((sqlite3_int64)digits[1]) << PyLong_SHIFT) | (sqlite3_int64)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(sqlite3_int64) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(sqlite3_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(sqlite3_int64) >= 3 * PyLong_SHIFT) {
                            return (sqlite3_int64) (((((((sqlite3_int64)digits[2]) << PyLong_SHIFT) | (sqlite3_int64)digits[1]) << PyLong_SHIFT) | (sqlite3_int64)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(sqlite3_int64) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(sqlite3_int64, 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(sqlite3_int64) >= 4 * PyLong_SHIFT) {
                            return (sqlite3_int64) (((((((((sqlite3_int64)digits[3]) << PyLong_SHIFT) | (sqlite3_int64)digits[2]) << PyLong_SHIFT) | (sqlite3_int64)digits[1]) << PyLong_SHIFT) | (sqlite3_int64)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 (sqlite3_int64) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(sqlite3_int64) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(sqlite3_int64, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(sqlite3_int64) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(sqlite3_int64, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (sqlite3_int64) 0;
                case -1: __PYX_VERIFY_RETURN_INT(sqlite3_int64, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(sqlite3_int64,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(sqlite3_int64) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(sqlite3_int64, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(sqlite3_int64) - 1 > 2 * PyLong_SHIFT) {
                            return (sqlite3_int64) (((sqlite3_int64)-1)*(((((sqlite3_int64)digits[1]) << PyLong_SHIFT) | (sqlite3_int64)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(sqlite3_int64) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(sqlite3_int64, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(sqlite3_int64) - 1 > 2 * PyLong_SHIFT) {
                            return (sqlite3_int64) ((((((sqlite3_int64)digits[1]) << PyLong_SHIFT) | (sqlite3_int64)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(sqlite3_int64) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(sqlite3_int64, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(sqlite3_int64) - 1 > 3 * PyLong_SHIFT) {
                            return (sqlite3_int64) (((sqlite3_int64)-1)*(((((((sqlite3_int64)digits[2]) << PyLong_SHIFT) | (sqlite3_int64)digits[1]) << PyLong_SHIFT) | (sqlite3_int64)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(sqlite3_int64) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(sqlite3_int64, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(sqlite3_int64) - 1 > 3 * PyLong_SHIFT) {
                            return (sqlite3_int64) ((((((((sqlite3_int64)digits[2]) << PyLong_SHIFT) | (sqlite3_int64)digits[1]) << PyLong_SHIFT) | (sqlite3_int64)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(sqlite3_int64) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(sqlite3_int64, 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(sqlite3_int64) - 1 > 4 * PyLong_SHIFT) {
                            return (sqlite3_int64) (((sqlite3_int64)-1)*(((((((((sqlite3_int64)digits[3]) << PyLong_SHIFT) | (sqlite3_int64)digits[2]) << PyLong_SHIFT) | (sqlite3_int64)digits[1]) << PyLong_SHIFT) | (sqlite3_int64)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(sqlite3_int64) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(sqlite3_int64, 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(sqlite3_int64) - 1 > 4 * PyLong_SHIFT) {
                            return (sqlite3_int64) ((((((((((sqlite3_int64)digits[3]) << PyLong_SHIFT) | (sqlite3_int64)digits[2]) << PyLong_SHIFT) | (sqlite3_int64)digits[1]) << PyLong_SHIFT) | (sqlite3_int64)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(sqlite3_int64) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(sqlite3_int64, long, PyLong_AsLong(x))
            } else if (sizeof(sqlite3_int64) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(sqlite3_int64, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            sqlite3_int64 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 (sqlite3_int64) -1;
        }
    } else {
        sqlite3_int64 val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (sqlite3_int64) -1;
        val = __Pyx_PyInt_As_sqlite3_int64(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to sqlite3_int64");
    return (sqlite3_int64) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to sqlite3_int64");
    return (sqlite3_int64) -1;
}

/* 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))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_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;
}

/* 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 PY_VERSION_HEX >= 0x030300A0
        if (ev && Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
#endif
        if (!ev || !PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            if (!ev) {
                Py_INCREF(Py_None);
                ev = Py_None;
            } else if (PyTuple_Check(ev)) {
                if (PyTuple_GET_SIZE(ev) >= 1) {
                    PyObject *value;
#if CYTHON_COMPILING_IN_CPYTHON
                    value = PySequence_ITEM(ev, 0);
#else
                    value = PyTuple_GET_ITEM(ev, 0);
                    Py_INCREF(value);
#endif
                    Py_DECREF(ev);
                    ev = value;
                } else {
                    Py_INCREF(Py_None);
                    Py_DECREF(ev);
                    ev = Py_None;
                }
            }
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = ev;
            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
#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
#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;
        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)
{
    Py_INCREF(self->gi_name);
    return self->gi_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)
{
    Py_INCREF(self->gi_qualname);
    return self->gi_qualname;
}
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;
}

/* ModuleImport */
                        #ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

/* TypeImport */
                        #ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

/* 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) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
